Skip to content

Commit

Permalink
use ClusterIP for seed, rpc, validator if gateway is enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
eseiker committed Oct 22, 2024
1 parent b658ffc commit 2bc4265
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 15 deletions.
5 changes: 2 additions & 3 deletions 9c-internal/multiplanetary/network/9c-network.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ ingress:

gateway:
enabled: true
hostname: gateway-internal-odin.planetarium.network
services:
- hostname: odin-internal-rpc.nine-chronicles.com
backendRefs:
Expand All @@ -41,10 +40,10 @@ gateway:
port: 31238
kind: GRPCRoute
sectionName: grpc
- name: remote-headless-netmq
- name: remote-headless-zmq
port: 31234
kind: TCPRoute
sectionName: netmq
sectionName: zmq
- name: data-provider
hostname: odin-internal-dp.9c.gg
- name: market-service
Expand Down
6 changes: 2 additions & 4 deletions 9c-internal/multiplanetary/network/heimdall.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,20 @@ ingress:

gateway:
enabled: true
hostname: gateway-internal-heimdall.planetarium.network
services:
- hostname: heimdall-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
- name: remote-headless-zmq
port: 31234
kind: TCPRoute
sectionName: netmq
sectionName: zmq
- name: data-provider
hostname: heimdall-internal-dp.9c.gg
- name: market-service
Expand Down
2 changes: 1 addition & 1 deletion charts/all-in-one/templates/gateway-route.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
labelselector: app.kubernetes.io/instance=traefik-{{ $.Release.Name }}
gatewayClass:
name: traefik-{{ $.Release.Name }}
globalArguments:
additionalArguments:
- --providers.kubernetesgateway.statusaddress.service.name=traefik-{{ $.Release.Name }}
- --providers.kubernetesgateway.statusaddress.service.namespace={{ $.Release.Name }}
service:
Expand Down
28 changes: 22 additions & 6 deletions charts/all-in-one/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@ metadata:
labels:
app.kubernetes.io/instance: {{ $.Release.Name }}
annotations:
{{- with $.Values.global.service.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- if not $.Values.gateway.enabled }}
{{- toYaml $.Values.global.service.annotations | nindent 4 }}
service.beta.kubernetes.io/aws-load-balancer-target-group-attributes: stickiness.enabled=true,stickiness.type=source_ip,preserve_client_ip.enabled=true
service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags: Environment={{- if eq $.Values.clusterName "9c-main-v2" }}production{{- else }}development{{- end }},Team=game,Owner=jihyung,Service={{ $.Release.Name }},Name=tcp-seed-{{ $index }}
{{- if index $.Values.seed.hosts $idx }}
external-dns.alpha.kubernetes.io/hostname: {{ index $.Values.seed.hosts $idx }}
external-dns.alpha.kubernetes.io/ttl: '60'
{{- end }}
{{- end }}
spec:
externalTrafficPolicy: Local
ports:
- port: {{ $.Values.seed.ports.node }}
targetPort: {{ $.Values.seed.ports.node }}
Expand All @@ -36,7 +35,12 @@ spec:
name: gossip
selector:
app: tcp-seed-{{ $index }}
{{- if not $.Values.gateway.enabled }}
type: LoadBalancer
externalTrafficPolicy: Local
{{- else }}
type: ClusterIP
{{- end }}
---
{{ end }}

Expand All @@ -51,15 +55,16 @@ metadata:
labels:
app.kubernetes.io/instance: {{ $.Release.Name }}
annotations:
{{- if not $.Values.gateway.enabled }}
{{- toYaml $.Values.global.service.annotations | nindent 4 }}
service.beta.kubernetes.io/aws-load-balancer-target-group-attributes: stickiness.enabled=true,stickiness.type=source_ip,preserve_client_ip.enabled=true
service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags: Environment={{- if eq $.Values.clusterName "9c-main-v2" }}production{{- else }}development{{- end }},Team=game,Owner=jihyung,Service={{ $.Release.Name }},Name=remote-headless-{{ $index }}
{{- if index $.Values.remoteHeadless.hosts $idx }}
external-dns.alpha.kubernetes.io/hostname: {{ index $.Values.remoteHeadless.hosts $idx }}
external-dns.alpha.kubernetes.io/ttl: '60'
{{- end }}
{{- end }}
spec:
externalTrafficPolicy: Local
ports:
- name: graphql
port: {{ $.Values.remoteHeadless.ports.graphql }}
Expand All @@ -75,7 +80,12 @@ spec:
targetPort: {{ $.Values.remoteHeadless.ports.graphql }}
selector:
app: remote-headless-{{ $index }}
{{- if not $.Values.gateway.enabled }}
type: LoadBalancer
externalTrafficPolicy: Local
{{- else }}
type: ClusterIP
{{- end }}

---
{{ end }}
Expand Down Expand Up @@ -530,15 +540,16 @@ metadata:
labels:
app.kubernetes.io/instance: {{ $.Release.Name }}
annotations:
{{- if not $.Values.gateway.enabled }}
{{- toYaml $.Values.global.service.annotations | nindent 4 }}
service.beta.kubernetes.io/aws-load-balancer-target-group-attributes: stickiness.enabled=true,stickiness.type=source_ip,preserve_client_ip.enabled=true
service.beta.kubernetes.io/aws-load-balancer-additional-resource-tags: Environment={{- if eq $.Values.clusterName "9c-main-v2" }}production{{- else }}development{{- end }},Team=game,Owner=jihyung,Service={{ $.Release.Name }},Name=validator-{{ $index }}
{{- if index $.Values.validator.hosts $idx }}
external-dns.alpha.kubernetes.io/hostname: {{ index $.Values.validator.hosts $idx }}
external-dns.alpha.kubernetes.io/ttl: '60'
{{- end }}
{{- end }}
spec:
externalTrafficPolicy: Local
ports:
- port: {{ $.Values.validator.ports.headless }}
targetPort: {{ $.Values.validator.ports.headless }}
Expand All @@ -555,7 +566,12 @@ spec:
protocol: TCP
selector:
app: validator-{{ $index }}
{{- if not $.Values.gateway.enabled }}
type: LoadBalancer
externalTrafficPolicy: Local
{{- else }}
type: ClusterIP
{{- end }}

---
{{ end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/all-in-one/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ingress:
gateway:
enabled: false
ports:
netmq:
zmq:
port: 31234
gatewayProtocol: TCP
grpc:
Expand Down

0 comments on commit 2bc4265

Please sign in to comment.