diff --git a/9c-internal/multiplanetary/network/9c-network.yaml b/9c-internal/multiplanetary/network/9c-network.yaml index 8c2ed2a9..cb2eb3a7 100644 --- a/9c-internal/multiplanetary/network/9c-network.yaml +++ b/9c-internal/multiplanetary/network/9c-network.yaml @@ -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 diff --git a/9c-internal/multiplanetary/network/heimdall.yaml b/9c-internal/multiplanetary/network/heimdall.yaml index ec60dacb..0413042a 100644 --- a/9c-internal/multiplanetary/network/heimdall.yaml +++ b/9c-internal/multiplanetary/network/heimdall.yaml @@ -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 diff --git a/9c-internal/multiplanetary/network/thor.yaml b/9c-internal/multiplanetary/network/thor.yaml index 1b92dde4..bca58b6a 100644 --- a/9c-internal/multiplanetary/network/thor.yaml +++ b/9c-internal/multiplanetary/network/thor.yaml @@ -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 diff --git a/charts/all-in-one/templates/gateway-route.yaml b/charts/all-in-one/templates/gateway.yaml similarity index 76% rename from charts/all-in-one/templates/gateway-route.yaml rename to charts/all-in-one/templates/gateway.yaml index ae6a5773..ee4400e5 100644 --- a/charts/all-in-one/templates/gateway-route.yaml +++ b/charts/all-in-one/templates/gateway.yaml @@ -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 }} @@ -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: @@ -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 }} @@ -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 }} diff --git a/charts/all-in-one/values.yaml b/charts/all-in-one/values.yaml index c551ec4f..36e2db92 100644 --- a/charts/all-in-one/values.yaml +++ b/charts/all-in-one/values.yaml @@ -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