-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgw.yaml
More file actions
98 lines (97 loc) · 2.77 KB
/
gw.yaml
File metadata and controls
98 lines (97 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: {{ include "tenant.name" . }}-gw-seed-backend
namespace: {{ .Release.Namespace }}
spec:
gatewayClassName: {{ include "tenant.name" . }}
listeners:
- name: http
protocol: HTTP
{{- if and (or (eq .Values.infra.tls.issuer "letsencrypt") (eq .Values.infra.tls.issuer "letsencrypt-staging")) (eq .Values.infra.tls.acme.solver "Gateway") }}
port: 80
{{- else }}
port: {{ .Values.envoy.service.seedBackendPort }}
{{- end }}
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "tenant.name" . }}-gw-seed-backend
namespace: {{ .Release.Namespace }}
---
apiVersion: v1
kind: Service
metadata:
name: {{ include "tenant.name" . }}-gw-seed-backend
namespace: {{ .Release.Namespace }}
spec:
ports:
- name: http
port: 3000
targetPort: 3000
selector:
app: {{ include "tenant.name" . }}-gw-seed-backend
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "tenant.name" . }}-gw-seed-backend
namespace: {{ .Release.Namespace }}
spec:
replicas: 1
selector:
matchLabels:
app: {{ include "tenant.name" . }}-gw-seed-backend
template:
metadata:
labels:
app: {{ include "tenant.name" . }}-gw-seed-backend
spec:
serviceAccountName: {{ include "tenant.name" . }}-gw-seed-backend
containers:
- image: "{{ .Values.echoserver.image }}:{{ .Values.echoserver.tag }}"
imagePullPolicy: IfNotPresent
name: backend
ports:
- containerPort: 3000
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if eq "true" ( include "distro.openshift" . ) }}
securityContext:
{{- toYaml (omit .Values.echoserver.securityContext "runAsUser" "runAsGroup" "fsGroup" "supplementalGroups") | nindent 12 }}
{{- else }}
securityContext:
{{- toYaml .Values.echoserver.securityContext | nindent 12 }}
{{- end }}
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: {{ include "tenant.name" . }}-gw-seed-backend
namespace: {{ .Release.Namespace }}
spec:
parentRefs:
- name: {{ include "tenant.name" . }}-gw-seed-backend
{{- if eq .Values.infra.hostType "domain" }}
hostnames:
- {{ include "gateway.domain" . }}
{{- end }}
rules:
- backendRefs:
- group: ""
kind: Service
name: {{ include "tenant.name" . }}-gw-seed-backend
port: 3000
weight: 1
matches:
- path:
type: Exact
value: /info