Skip to content

Commit 2bec5b2

Browse files
chore: support gcp multi cluster ingress
1 parent 25ccaf4 commit 2bec5b2

File tree

5 files changed

+85
-1
lines changed

5 files changed

+85
-1
lines changed

manifests/bucketeer/charts/web/templates/ingress.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.ingress.enabled }}
12
apiVersion: networking.k8s.io/v1
23
kind: Ingress
34
metadata:
@@ -22,4 +23,5 @@ spec:
2223
rules:
2324
- host: {{ .Values.ingress.host }}
2425
http:
25-
paths: {{- toYaml .Values.ingress.rulePaths | nindent 10 }}
26+
paths: {{- toYaml .Values.ingress.rulePaths | nindent 10 }}
27+
{{- end }}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{{- if and .Values.multiClusterIngress.enabled .Values.env.gcpEnabled }}
2+
apiVersion: networking.gke.io/v1
3+
kind: MultiClusterIngress
4+
metadata:
5+
name: {{ .Values.multiClusterIngress.name }}
6+
namespace: {{ .Values.namespace }}
7+
labels:
8+
app: {{ template "web.name" . }}
9+
chart: {{ template "web.chart" . }}
10+
release: {{ template "web.fullname" . }}
11+
heritage: {{ .Release.Service }}
12+
annotations:
13+
networking.gke.io/static-ip: {{ .Values.multiClusterIngress.staticIPName }}
14+
spec:
15+
template:
16+
spec:
17+
backend:
18+
serviceName: {{ template "web.fullname" . }}
19+
servicePort: {{ .Values.service.httpPort }}
20+
rules:
21+
- host: {{ .Values.multiClusterIngress.host }}
22+
http:
23+
paths: {{- toYaml .Values.multiClusterIngress.rulePaths | nindent 14 }}
24+
{{- end }}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{{- if and .Values.multiClusterService.enabled .Values.env.gcpEnabled }}
2+
apiVersion: networking.gke.io/v1
3+
kind: MultiClusterService
4+
metadata:
5+
name: {{ .Values.multiClusterService.name }}
6+
namespace: {{ .Values.namespace }}
7+
labels:
8+
app: {{ template "web.name" . }}
9+
chart: {{ template "web.chart" . }}
10+
release: {{ template "web.fullname" . }}
11+
heritage: {{ .Release.Service }}
12+
annotations:
13+
cloud.google.com/backend-config: '{"default": "{{ template "web.fullname" . }}"}'
14+
cloud.google.com/app-protocols: '{"http-service":"HTTP2"}'
15+
cloud.google.com/neg: '{"ingress": true}'
16+
spec:
17+
template:
18+
spec:
19+
selector:
20+
app: {{ template "web.name" . }}
21+
release: {{ template "web.fullname" . }}
22+
ports:
23+
- name: grpc-service
24+
port: {{ .Values.service.grpcPort }}
25+
targetPort: envoy-grpc
26+
protocol: TCP
27+
- name: http-service
28+
port: {{ .Values.service.httpPort }}
29+
targetPort: envoy-http
30+
protocol: TCP
31+
- name: metrics
32+
port: {{ .Values.env.metricsPort }}
33+
protocol: TCP
34+
- name: admin
35+
port: {{ .Values.envoy.adminPort }}
36+
protocol: TCP
37+
{{- end }}

manifests/bucketeer/charts/web/templates/service.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if .Values.service.enabled }}
12
apiVersion: v1
23
kind: Service
34
metadata:
@@ -34,3 +35,4 @@ spec:
3435
selector:
3536
app: {{ template "web.name" . }}
3637
release: {{ template "web.fullname" . }}
38+
{{- end }}

manifests/bucketeer/charts/web/values.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ envoy:
118118
adminPort: 8001
119119
resources: {}
120120
service:
121+
enabled: true
121122
type: NodePort
122123
grpcPort: 9000
123124
httpPort: 9003
@@ -134,6 +135,7 @@ resources: {}
134135
serviceAccount:
135136
annotations: {}
136137
ingress:
138+
enabled: true
137139
name: web
138140
host:
139141
staticIPName:
@@ -144,3 +146,20 @@ ingress:
144146
name: web
145147
port:
146148
number: 9003
149+
150+
multiClusterService:
151+
enabled: false
152+
name: web-multi-cluster-service
153+
154+
155+
multiClusterIngress:
156+
enabled: false
157+
name: web-multi-cluster-ingress
158+
host: web-gateway.bucketeer.io
159+
staticIPName: web-multi-cluster-static-ip
160+
rulePaths:
161+
- path: /
162+
pathType: Prefix
163+
backend:
164+
serviceName: web
165+
servicePort: 9003

0 commit comments

Comments
 (0)