Skip to content

Commit

Permalink
simplify gateway configs & disable gRPC timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiker committed Oct 23, 2024
1 parent abd4d59 commit 18fd628
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 48 deletions.
16 changes: 5 additions & 11 deletions 9c-internal/multiplanetary/network/9c-network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,13 @@ ingress:
gateway:
enabled: true
services:
- hostname: odin-internal-rpc.nine-chronicles.com
- name: remote-headless
hostname: odin-internal-rpc.nine-chronicles.com
backendRefs:
- name: remote-headless-1
routes:
- name: remote-headless-graphql
- name: remote-headless-grpc
port: 31238
kind: GRPCRoute
sectionName: grpc
- name: remote-headless-netmq
port: 31234
kind: TCPRoute
sectionName: netmq
protocols:
- web
- grpc
- name: data-provider
hostname: odin-internal-dp.9c.gg
- name: market-service
Expand Down
16 changes: 5 additions & 11 deletions 9c-internal/multiplanetary/network/heimdall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,13 @@ ingress:
gateway:
enabled: true
services:
- hostname: heimdall-internal-rpc.nine-chronicles.com
- name: remote-headless
hostname: heimdall-internal-rpc.nine-chronicles.com
backendRefs:
- name: remote-headless-1
routes:
- name: remote-headless-graphql
- name: remote-headless-grpc
port: 31238
kind: GRPCRoute
sectionName: grpc
- name: remote-headless-netmq
port: 31234
kind: TCPRoute
sectionName: netmq
protocols:
- web
- grpc
- name: data-provider
hostname: heimdall-internal-dp.9c.gg
- name: market-service
Expand Down
18 changes: 5 additions & 13 deletions 9c-internal/multiplanetary/network/thor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,14 @@ ingress:

gateway:
enabled: true
hostname: gateway-internal-thor.planetarium.network
services:
- hostname: thor-internal-rpc.nine-chronicles.com
- name: remote-headless
hostname: thor-internal-rpc.nine-chronicles.com
backendRefs:
- name: remote-headless-1
- name: validator-5
routes:
- name: remote-headless-graphql
- name: remote-headless-grpc
port: 31238
kind: GRPCRoute
sectionName: grpc
- name: remote-headless-netmq
port: 31234
kind: TCPRoute
sectionName: netmq-thor
protocols:
- web
- grpc
- name: data-provider
hostname: thor-internal-dp.9c.gg
- name: market-service
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ metadata:
namespace: argocd
spec:
project: default
# syncPolicy:
# automated:
# prune: true
# selfHeal: true
destination:
server: https://kubernetes.default.svc
namespace: {{ $.Release.Name }}
Expand Down Expand Up @@ -43,9 +47,12 @@ spec:
{{- range $name, $config := $.Values.gateway.ports }}
{{ $name }}:
port: {{ $config.port }}
protocol: {{ $config.portProtocol | default "TCP" }}
expose:
default: true
{{- with $config.transport }}
transport:
{{- toYaml . | nindent 14 }}
{{- end }}
{{- end }}
gateway:
listeners:
Expand All @@ -55,21 +62,22 @@ spec:
{{- range $name, $config := $.Values.gateway.ports }}
{{ $name }}:
port: {{ $config.port }}
protocol: {{ $config.gatewayProtocol | default "HTTP" }}
protocol: {{ eq $config.kind "TCPRoute" | ternary "TCP" "HTTP" }}
{{- end }}
---
{{- range $service := $.Values.gateway.services }}
{{- range $route := $service.routes | default (list dict) }}
{{- $obj := merge $route $service }}
{{- range $protocol := $service.protocols | default (list "web") }}
{{- range $p, $obj := merge (dict "web" dict) ($.Values.gateway.ports) }}
{{- if eq $protocol $p }}
---
apiVersion: gateway.networking.k8s.io/v1{{ if eq $obj.kind "TCPRoute" }}alpha2{{ end }}
kind: {{ $obj.kind | default "HTTPRoute" }}
metadata:
name: gateway-{{ $obj.name }}
name: gateway-route-{{ $service.name }}-{{ $protocol }}
namespace: {{ $.Release.Name }}
annotations:
{{- if eq $obj.kind "TCPRoute" }}
{{- with $obj.hostname }}
{{- with $service.hostname }}
external-dns.alpha.kubernetes.io/hostname: {{ . }}
external-dns.alpha.kubernetes.io/ttl: '60'
{{- end }}
Expand All @@ -78,21 +86,23 @@ spec:
parentRefs:
- name: traefik-gateway
namespace: {{ $.Release.Name }}
sectionName: {{ $obj.sectionName | default "web" }}
sectionName: {{ $protocol }}
{{- if not (eq $obj.kind "TCPRoute") }}
hostnames:
{{- with ($obj.hostnames | default (list $obj.hostname)) }}
{{- with ($service.hostnames | default (list $service.hostname)) }}
{{ toYaml . | nindent 4 }}
{{- end }}
{{- end }}
rules:
- backendRefs:
{{- range $ref := $obj.backendRefs | default (list dict) }}
- name: {{ $ref.name | default $obj.name }}
{{- range $ref := $service.backendRefs | default (list dict) }}
- name: {{ $ref.name | default $service.name }}
port: {{ $ref.port | default $obj.port | default "80" }}
{{- end }}
---
{{- end }}
{{- end }}
{{- end }}
{{- end }}
---
{{- end }}
7 changes: 4 additions & 3 deletions charts/all-in-one/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,12 @@ ingress:
gateway:
enabled: false
ports:
netmq:
port: 31234
gatewayProtocol: TCP
grpc:
kind: GRPCRoute
port: 31238
transport:
respondingTimeouts:
readTimeout: 0

seed:
count: 1
Expand Down

0 comments on commit 18fd628

Please sign in to comment.