1 {{- if or .Values.deployment.kong.enabled .Values.ingressController.enabled }}
3 {{- if .Values.deployment.daemonset }}
9 name: {{ template "kong.fullname" . }}
10 namespace: {{ template "kong.namespace" . }}
12 {{- include "kong.metaLabels" . | nindent 4 }}
13 app.kubernetes.io/component: app
14 {{- if .Values.deploymentAnnotations }}
16 {{- range $key, $value := .Values.deploymentAnnotations }}
17 {{ $key }}: {{ include "kong.renderTpl" (dict "value" $value "context" $) | quote }}
21 {{- if not .Values.autoscaling.enabled }}
22 {{- if not .Values.deployment.daemonset }}
23 replicas: {{ .Values.replicaCount }}
28 {{- include "kong.selectorLabels" . | nindent 6 }}
29 {{- if .Values.updateStrategy }}
30 {{- if .Values.deployment.daemonset }}
35 {{ toYaml .Values.updateStrategy | indent 4 }}
37 {{- if .Values.deployment.minReadySeconds }}
38 minReadySeconds: {{ .Values.deployment.minReadySeconds }}
44 {{- if (and (not .Values.deployment.serviceAccount.automountServiceAccountToken) (or .Values.deployment.serviceAccount.create .Values.deployment.serviceAccount.name)) }}
45 kuma.io/service-account-token-volume: {{ template "kong.serviceAccountTokenName" . }}
47 {{- if (and (not .Values.ingressController.enabled) (eq .Values.env.database "off" )) }}
48 {{- if .Values.dblessConfig.config }}
49 checksum/dbless.config: {{ toYaml .Values.dblessConfig.config | sha256sum }}
52 {{- if .Values.podAnnotations }}
53 {{- range $key, $value := .Values.podAnnotations }}
54 {{ $key }}: {{ include "kong.renderTpl" (dict "value" $value "context" $) | quote }}
58 {{- include "kong.metaLabels" . | nindent 8 }}
59 app.kubernetes.io/component: app
60 app: {{ template "kong.fullname" . }}
61 version: {{ .Chart.AppVersion | quote }}
62 {{- if .Values.podLabels }}
63 {{ include "kong.renderTpl" (dict "value" .Values.podLabels "context" $) | nindent 8 }}
66 {{- if .Values.deployment.hostname }}
67 hostname: {{ .Values.deployment.hostname }}
69 {{- if .Values.deployment.hostNetwork }}
72 {{- if .Values.priorityClassName }}
73 priorityClassName: "{{ .Values.priorityClassName }}"
75 {{- if or .Values.deployment.serviceAccount.create .Values.deployment.serviceAccount.name }}
76 serviceAccountName: {{ template "kong.serviceAccountName" . }}
78 {{- if (and (or .Values.deployment.serviceAccount.create .Values.deployment.serviceAccount.name) .Values.deployment.serviceAccount.automountServiceAccountToken) }}
79 automountServiceAccountToken: true
81 automountServiceAccountToken: false
83 {{- if .Values.image.pullSecrets }}
85 {{- range .Values.image.pullSecrets }}
89 {{- if .Values.deployment.kong.enabled }}
91 - name: clear-stale-pid
92 image: {{ include "kong.getRepoTag" .Values.image }}
93 imagePullPolicy: {{ .Values.image.pullPolicy }}
95 {{ toYaml .Values.containerSecurityContext | nindent 10 }}
97 {{ toYaml .Values.resources | indent 10 }}
101 - "$KONG_PREFIX/pids"
103 {{- include "kong.env" . | nindent 8 }}
104 {{- include "kong.envFrom" .Values.envFrom | nindent 8 }}
106 {{- include "kong.volumeMounts" . | nindent 8 }}
107 {{- if .Values.deployment.initContainers }}
108 {{- toYaml .Values.deployment.initContainers | nindent 6 }}
110 {{- if (and (not (eq .Values.env.database "off")) .Values.waitImage.enabled) }}
111 {{- include "kong.wait-for-db" . | nindent 6 }}
114 {{- if .Values.deployment.hostAliases }}
116 {{- toYaml .Values.deployment.hostAliases | nindent 6 }}
118 {{- if .Values.dnsPolicy }}
119 dnsPolicy: {{ .Values.dnsPolicy | quote }}
121 {{- if .Values.dnsConfig }}
123 {{ toYaml .Values.dnsConfig | indent 8 }}
126 {{- if .Values.ingressController.enabled }}
127 {{- include "kong.controller-container" . | nindent 6 }}
129 {{- if .Values.deployment.sidecarContainers }}
130 {{- toYaml .Values.deployment.sidecarContainers | nindent 6 }}
132 {{- if .Values.deployment.kong.enabled }}
134 image: {{ include "kong.getRepoTag" .Values.image }}
135 imagePullPolicy: {{ .Values.image.pullPolicy }}
137 {{ toYaml .Values.containerSecurityContext | nindent 10 }}
139 {{- include "kong.no_daemon_env" . | nindent 8 }}
140 {{- include "kong.envFrom" .Values.envFrom | nindent 8 }}
142 {{- toYaml .Values.lifecycle | nindent 10 }}
144 {{- if (and .Values.admin.http.enabled .Values.admin.enabled) }}
146 containerPort: {{ .Values.admin.http.containerPort }}
147 {{- if .Values.admin.http.hostPort }}
148 hostPort: {{ .Values.admin.http.hostPort }}
152 {{- if (and .Values.admin.tls.enabled .Values.admin.enabled) }}
154 containerPort: {{ .Values.admin.tls.containerPort }}
155 {{- if .Values.admin.tls.hostPort }}
156 hostPort: {{ .Values.admin.tls.hostPort }}
160 {{- if (and .Values.proxy.http.enabled .Values.proxy.enabled) }}
162 containerPort: {{ .Values.proxy.http.containerPort }}
163 {{- if .Values.proxy.http.hostPort }}
164 hostPort: {{ .Values.proxy.http.hostPort }}
168 {{- if (and .Values.proxy.tls.enabled .Values.proxy.enabled)}}
170 containerPort: {{ .Values.proxy.tls.containerPort }}
171 {{- if .Values.proxy.tls.hostPort }}
172 hostPort: {{ .Values.proxy.tls.hostPort }}
176 {{- range .Values.proxy.stream }}
177 - name: stream{{ if (eq (default "TCP" .protocol) "UDP") }}udp{{ end }}-{{ .containerPort }}
178 containerPort: {{ .containerPort }}
180 hostPort: {{ .hostPort }}
182 protocol: {{ .protocol }}
184 {{- range .Values.udpProxy.stream }}
185 - name: streamudp-{{ .containerPort }}
186 containerPort: {{ .containerPort }}
188 hostPort: {{ .hostPort }}
190 protocol: {{ .protocol }}
192 {{- if (and .Values.status.http.enabled .Values.status.enabled)}}
194 containerPort: {{ .Values.status.http.containerPort }}
195 {{- if .Values.status.http.hostPort }}
196 hostPort: {{ .Values.status.http.hostPort }}
200 {{- if (and .Values.status.tls.enabled .Values.status.enabled) }}
202 containerPort: {{ .Values.status.tls.containerPort }}
203 {{- if .Values.status.tls.hostPort }}
204 hostPort: {{ .Values.status.tls.hostPort }}
208 {{- if (and .Values.cluster.tls.enabled .Values.cluster.enabled) }}
210 containerPort: {{ .Values.cluster.tls.containerPort }}
211 {{- if .Values.cluster.tls.hostPort }}
212 hostPort: {{ .Values.cluster.tls.hostPort }}
216 {{- if .Values.enterprise.enabled }}
217 {{- if (and .Values.manager.http.enabled .Values.manager.enabled) }}
219 containerPort: {{ .Values.manager.http.containerPort }}
220 {{- if .Values.manager.http.hostPort }}
221 hostPort: {{ .Values.manager.http.hostPort }}
225 {{- if (and .Values.manager.tls.enabled .Values.manager.enabled) }}
227 containerPort: {{ .Values.manager.tls.containerPort }}
228 {{- if .Values.manager.tls.hostPort }}
229 hostPort: {{ .Values.manager.tls.hostPort }}
233 {{- if (and .Values.portal.http.enabled .Values.portal.enabled) }}
235 containerPort: {{ .Values.portal.http.containerPort }}
236 {{- if .Values.portal.http.hostPort }}
237 hostPort: {{ .Values.portal.http.hostPort }}
241 {{- if (and .Values.portal.tls.enabled .Values.portal.enabled) }}
243 containerPort: {{ .Values.portal.tls.containerPort }}
244 {{- if .Values.portal.tls.hostPort }}
245 hostPort: {{ .Values.portal.tls.hostPort }}
249 {{- if (and .Values.portalapi.http.enabled .Values.portalapi.enabled) }}
251 containerPort: {{ .Values.portalapi.http.containerPort }}
252 {{- if .Values.portalapi.http.hostPort }}
253 hostPort: {{ .Values.portalapi.http.hostPort }}
257 {{- if (and .Values.portalapi.tls.enabled .Values.portalapi.enabled) }}
258 - name: portalapi-tls
259 containerPort: {{ .Values.portalapi.tls.containerPort }}
260 {{- if .Values.portalapi.tls.hostPort }}
261 hostPort: {{ .Values.portalapi.tls.hostPort }}
265 {{- if (and .Values.clustertelemetry.tls.enabled .Values.clustertelemetry.enabled) }}
267 containerPort: {{ .Values.clustertelemetry.tls.containerPort }}
268 {{- if .Values.clustertelemetry.tls.hostPort }}
269 hostPort: {{ .Values.clustertelemetry.tls.hostPort }}
275 {{- include "kong.volumeMounts" . | nindent 10 }}
276 {{- include "kong.userDefinedVolumeMounts" .Values.deployment | nindent 10 }}
278 {{ include "kong.proxy.compatibleReadiness" . | indent 10 }}
280 {{ toYaml .Values.livenessProbe | indent 10 }}
281 {{- if .Values.startupProbe }}
283 {{ toYaml .Values.startupProbe | indent 10 }}
286 {{ toYaml .Values.resources | indent 10 }}
287 {{- end }} {{/* End of Kong container spec */}}
288 {{- if .Values.affinity }}
290 {{ toYaml .Values.affinity | indent 8 }}
292 {{- if .Values.topologySpreadConstraints }}
293 topologySpreadConstraints:
294 {{ toYaml .Values.topologySpreadConstraints | indent 8 }}
297 {{- include "kong.podsecuritycontext" . | nindent 8 }}
298 {{- if .Values.nodeSelector }}
300 {{ toYaml .Values.nodeSelector | indent 8 }}
302 terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
303 {{- if .Values.tolerations }}
305 {{ toYaml .Values.tolerations | indent 8 }}
308 {{- include "kong.volumes" . | nindent 8 -}}
309 {{- include "kong.userDefinedVolumes" . | nindent 8 -}}