Update Kong ingress controller to version 1.4. It fixes the occasional 404 error.
[ric-plt/ric-dep.git] / helm / infrastructure / subcharts / kong / templates / deployment.yaml
1 apiVersion: apps/v1
2 kind: Deployment
3 metadata:
4   name: {{ template "kong.fullname" . }}
5   labels:
6     {{- include "kong.metaLabels" . | nindent 4 }}
7     app.kubernetes.io/component: app
8 spec:
9   replicas: {{ .Values.replicaCount }}
10   selector:
11     matchLabels:
12       {{- include "kong.selectorLabels" . | nindent 6 }}
13   {{- if .Values.updateStrategy }}
14   strategy:
15 {{ toYaml .Values.updateStrategy | indent 4 }}
16   {{- end }}
17
18   template:
19     metadata:
20       annotations:
21         {{- if .Values.ingressController.admissionWebhook.enabled }}
22         checksum/admission-webhook.yaml: {{ include (print $.Template.BasePath "/admission-webhook.yaml") . | sha256sum }}
23         {{- end }}
24         {{- if (and (not .Values.ingressController.enabled) (eq .Values.env.database "off" )) }}
25         {{- if .Values.dblessConfig.config }}
26         checksum/dbless.config: {{ toYaml .Values.dblessConfig.config | sha256sum }}
27         {{- end }}
28         {{- end }}
29         {{- if .Values.podAnnotations }}
30 {{ toYaml .Values.podAnnotations | indent 8 }}
31         {{- end }}
32       labels:
33         {{- include "kong.metaLabels" . | nindent 8 }}
34         app.kubernetes.io/component: app
35     spec:
36       {{- if or .Values.ingressController.enabled .Values.podSecurityPolicy.enabled }}
37       serviceAccountName: {{ template "kong.serviceAccountName" . }}
38       {{ end }}
39       {{- if .Values.image.pullSecrets }}
40       imagePullSecrets:
41       {{- range .Values.image.pullSecrets }}
42         - name: {{ . }}
43       {{- end }}
44       {{- end }}
45       {{- if not (eq .Values.env.database "off") }}
46       initContainers:
47       {{- include "kong.wait-for-db" . | nindent 6 }}
48       {{ end }}
49       containers:
50       {{- if .Values.ingressController.enabled }}
51       {{- include "kong.controller-container" . | nindent 6 }}
52       {{ end }}
53       - name: "proxy"
54         image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
55         imagePullPolicy: {{ .Values.image.pullPolicy }}
56         env:
57         {{- include "kong.final_env" . | nindent 8 }}
58         lifecycle:
59           preStop:
60             exec:
61               command: [ "/bin/sh", "-c", "kong quit" ]
62         ports:
63         - name: admin
64           containerPort: {{ .Values.admin.containerPort }}
65           {{- if .Values.admin.hostPort }}
66           hostPort: {{ .Values.admin.hostPort }}
67           {{- end}}
68           protocol: TCP
69         {{- if .Values.proxy.http.enabled }}
70         - name: proxy
71           containerPort: {{ .Values.proxy.http.containerPort }}
72           {{- if .Values.proxy.http.hostPort }}
73           hostPort: {{ .Values.proxy.http.hostPort }}
74           {{- end}}
75           protocol: TCP
76         {{- end }}
77         {{- if .Values.proxy.tls.enabled }}
78         - name: proxy-tls
79           containerPort: {{ .Values.proxy.tls.containerPort }}
80           {{- if .Values.proxy.tls.hostPort }}
81           hostPort: {{ .Values.proxy.tls.hostPort }}
82           {{- end}}
83           protocol: TCP
84         {{- end }}
85         - name: metrics
86           containerPort: 9542
87           protocol: TCP
88         {{- if .Values.ingressController.admissionWebhook.enabled }}
89         - name: webhook
90           containerPort: {{ .Values.ingressController.admissionWebhook.port }}
91           protocol: TCP
92         {{- end }}
93         {{- if .Values.enterprise.enabled }}
94         {{- if .Values.manager.http.enabled }}
95         - name: manager
96           containerPort: {{ .Values.manager.http.containerPort }}
97           {{- if .Values.manager.http.hostPort }}
98           hostPort: {{ .Values.manager.http.hostPort }}
99           {{- end}}
100           protocol: TCP
101         {{- end }}
102         {{- if .Values.manager.tls.enabled }}
103         - name: manager-tls
104           containerPort: {{ .Values.manager.tls.containerPort }}
105           {{- if .Values.manager.tls.hostPort }}
106           hostPort: {{ .Values.manager.tls.hostPort }}
107           {{- end}}
108           protocol: TCP
109         {{- end }}
110         {{- if .Values.portal.http.enabled }}
111         - name: portal
112           containerPort: {{ .Values.portal.http.containerPort }}
113           {{- if .Values.portal.http.hostPort }}
114           hostPort: {{ .Values.portal.http.hostPort }}
115           {{- end}}
116           protocol: TCP
117         {{- end }}
118         {{- if .Values.portal.tls.enabled }}
119         - name: portal-tls
120           containerPort: {{ .Values.portal.tls.containerPort }}
121           {{- if .Values.portal.tls.hostPort }}
122           hostPort: {{ .Values.portal.tls.hostPort }}
123           {{- end}}
124           protocol: TCP
125         {{- end }}
126         {{- if .Values.portalapi.http.enabled }}
127         - name: portalapi
128           containerPort: {{ .Values.portalapi.http.containerPort }}
129           {{- if .Values.portalapi.http.hostPort }}
130           hostPort: {{ .Values.portalapi.http.hostPort }}
131           {{- end}}
132           protocol: TCP
133         {{- end }}
134         {{- if .Values.portalapi.tls.enabled }}
135         - name: portalapi-tls
136           containerPort: {{ .Values.portalapi.tls.containerPort }}
137           {{- if .Values.portalapi.tls.hostPort }}
138           hostPort: {{ .Values.portalapi.tls.hostPort }}
139           {{- end}}
140           protocol: TCP
141         {{- end }}
142         {{- end }}
143         volumeMounts:
144         {{- include "kong.volumeMounts" . | nindent 10 }}
145         readinessProbe:
146 {{ toYaml .Values.readinessProbe | indent 10 }}
147         livenessProbe:
148 {{ toYaml .Values.livenessProbe | indent 10 }}
149         resources:
150 {{ toYaml .Values.resources | indent 10 }}
151     {{- if .Values.affinity }}
152       affinity:
153 {{ toYaml .Values.affinity | indent 8 }}
154     {{- end }}
155       securityContext:
156       {{- include "kong.podsecuritycontext" . | nindent 8 }}
157     {{- if .Values.nodeSelector }}
158       nodeSelector:
159 {{ toYaml .Values.nodeSelector | indent 8 }}
160     {{- end }}
161       tolerations:
162 {{ toYaml .Values.tolerations | indent 8 }}
163       volumes:
164       {{- include "kong.volumes" . | nindent 8 -}}