add the forked kong subcharts to avoid helm update
[it/dep.git] / ric-aux / 80-Auxiliary-Functions / helm / kong / charts / kong / templates / deployment.yaml
1 apiVersion: apps/v1beta2
2 kind: Deployment
3 metadata:
4   name: "{{ template "kong.fullname" . }}"
5   labels:
6     app: "{{ template "kong.name" . }}"
7     chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
8     release: "{{ .Release.Name }}"
9     heritage: "{{ .Release.Service }}"
10     component: app
11 spec:
12   replicas: {{ .Values.replicaCount }}
13   selector:
14     matchLabels:
15       app: {{ template "kong.name" . }}
16       release: {{ .Release.Name }}
17       component: app
18   template:
19     metadata:
20     {{- if .Values.podAnnotations }}
21       annotations:
22 {{ toYaml .Values.podAnnotations | indent 8 }}
23     {{- end }}
24       labels:
25         app: {{ template "kong.name" . }}
26         release: {{ .Release.Name }}
27         component: app
28     spec:
29       {{- if (and (.Values.ingressController) (eq .Values.env.database "off")) }}
30       serviceAccountName: {{ template "kong.serviceAccountName" . }}
31       {{ end }}
32       {{- if .Values.image.pullSecrets }}
33       imagePullSecrets:
34       {{- range .Values.image.pullSecrets }}
35         - name: {{ . }}
36       {{- end }}
37       {{- end }}
38       {{- if not (eq .Values.env.database "off") }}
39       initContainers:
40       {{- include "kong.wait-for-db" . | nindent 6 }}
41       {{ end }}
42       containers:
43       {{- if (and (.Values.ingressController) (eq .Values.env.database "off")) }}
44       {{- include "kong.controller-container" . | nindent 6 }}
45       {{ end }}
46       - name: {{ template "kong.name" . }}
47         image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
48         imagePullPolicy: {{ .Values.image.pullPolicy }}
49         env:
50         {{- if not .Values.env.admin_listen }}
51         {{- if .Values.admin.useTLS }}
52         - name: KONG_ADMIN_LISTEN
53           value: "0.0.0.0:{{ .Values.admin.containerPort }} ssl"
54         {{- else }}
55         - name: KONG_ADMIN_LISTEN
56           value: 0.0.0.0:{{ .Values.admin.containerPort }}
57         {{- end }}
58         {{- end }}
59         {{- if not .Values.env.proxy_listen }}
60         - name: KONG_PROXY_LISTEN
61           value: {{ template "kong.kongProxyListenValue" . }}
62         {{- end }}
63         {{- if and (not .Values.env.admin_gui_listen) (.Values.enterprise.enabled) }}
64         - name: KONG_ADMIN_GUI_LISTEN
65           value: {{ template "kong.kongManagerListenValue" . }}
66         {{- end }}
67         {{- if and (not .Values.env.portal_gui_listen) (.Values.enterprise.enabled) (.Values.enterprise.portal.enabled) }}
68         - name: KONG_PORTAL_GUI_LISTEN
69           value: {{ template "kong.kongPortalListenValue" . }}
70         {{- end }}
71         {{- if and (not .Values.env.portal_api_listen) (.Values.enterprise.enabled) (.Values.enterprise.portal.enabled) }}
72         - name: KONG_PORTAL_API_LISTEN
73           value: {{ template "kong.kongPortalApiListenValue" . }}
74         {{- end }}
75         - name: KONG_NGINX_DAEMON
76           value: "off"
77         {{- if .Values.enterprise.enabled }}
78         {{- if .Values.enterprise.vitals.enabled }}
79         - name: KONG_VITALS
80           value: "on"
81         {{- end }}
82         {{- if .Values.enterprise.portal.enabled }}
83         - name: KONG_PORTAL
84           value: "on"
85         {{- if .Values.enterprise.portal.portal_auth }}
86         - name: KONG_PORTAL_AUTH
87           value: {{ .Values.enterprise.portal.portal_auth }}
88         - name: KONG_PORTAL_SESSION_CONF
89           valueFrom:
90             secretKeyRef:
91               name: {{ .Values.enterprise.portal.session_conf_secret }}
92               key: portal_session_conf
93         {{- end }}
94         {{- end }}
95         {{- if .Values.enterprise.rbac.enabled }}
96         - name: KONG_ENFORCE_RBAC
97           value: "on"
98         - name: KONG_ADMIN_GUI_AUTH
99           value: {{ .Values.enterprise.rbac.admin_gui_auth | default "basic-auth" }}
100         - name: KONG_ADMIN_GUI_AUTH_CONF
101           value: {{ toJson .Values.enterprise.rbac.admin_gui_auth_conf | default "" }}
102         - name: KONG_ADMIN_GUI_SESSION_CONF
103           valueFrom:
104             secretKeyRef:
105               name: {{ .Values.enterprise.rbac.session_conf_secret }}
106               key: admin_gui_session_conf
107         {{- end }}
108         {{- if .Values.enterprise.smtp.enabled }}
109         - name: KONG_PORTAL_EMAILS_FROM
110           value: {{ .Values.enterprise.smtp.portal_emails_from }}
111         - name: KONG_PORTAL_EMAILS_REPLY_TO
112           value: {{ .Values.enterprise.smtp.portal_emails_reply_to }}
113         - name: KONG_ADMIN_EMAILS_FROM
114           value: {{ .Values.enterprise.smtp.admin_emails_from }}
115         - name: KONG_ADMIN_EMAILS_REPLY_TO
116           value: {{ .Values.enterprise.smtp.admin_emails_reply_to }}
117         - name: KONG_SMTP_HOST
118           value: {{ .Values.enterprise.smtp.smtp_host }}
119         - name: KONG_SMTP_PORT
120           value: {{ .Values.enterprise.smtp.smtp_port }}
121         - name: KONG_SMTP_STARTTLS
122           value: {{ .Values.enterprise.smtp.smtp_starttls }}
123         {{- if .Values.enterprise.smtp.auth.smtp_username }}
124         - name: KONG_SMTP_USERNAME
125           value: {{ .Values.enterprise.smtp.auth.smtp_username }}
126         - name: KONG_SMTP_PASSWORD
127           valueFrom:
128             secretKeyRef:
129               name: {{ .Values.enterprise.smtp.auth.smtp_password }}
130               key: smtp_password
131         {{- end }}
132         {{- else }}
133         - name: KONG_SMTP_MOCK
134           value: "on"
135         {{- end }}
136         {{- include "kong.license" . | nindent 8 }}
137         {{- end }}
138         {{- include "kong.env" .  | indent 8 }}
139         {{- if .Values.postgresql.enabled }}
140         - name: KONG_PG_HOST
141           value: {{ template "kong.postgresql.fullname" . }}
142         - name: KONG_PG_PORT
143           value: "{{ .Values.postgresql.service.port }}"
144         - name: KONG_PG_PASSWORD
145           valueFrom:
146             secretKeyRef:
147               name: {{ template "kong.postgresql.fullname" . }}
148               key: postgresql-password
149         {{- end }}
150         {{- if .Values.cassandra.enabled }}
151         - name: KONG_CASSANDRA_CONTACT_POINTS
152           value: {{ template "kong.cassandra.fullname" . }}
153         {{- end }}
154         ports:
155         - name: admin
156           containerPort: {{ .Values.admin.containerPort }}
157           {{- if .Values.admin.hostPort }}
158           hostPort: {{ .Values.admin.hostPort }}
159           {{- end}}
160           protocol: TCP
161         {{- if .Values.proxy.http.enabled }}
162         - name: proxy
163           containerPort: {{ .Values.proxy.http.containerPort }}
164           {{- if .Values.proxy.http.hostPort }}
165           hostPort: {{ .Values.proxy.http.hostPort }}
166           {{- end}}
167           protocol: TCP
168         {{- end }}
169         {{- if .Values.proxy.tls.enabled }}
170         - name: proxy-tls
171           containerPort: {{ .Values.proxy.tls.containerPort }}
172           {{- if .Values.proxy.tls.hostPort }}
173           hostPort: {{ .Values.proxy.tls.hostPort }}
174           {{- end}}
175           protocol: TCP
176         {{- end }}
177         {{- if .Values.enterprise.enabled }}
178         {{- if .Values.manager.http.enabled }}
179         - name: manager
180           containerPort: {{ .Values.manager.http.containerPort }}
181           {{- if .Values.manager.http.hostPort }}
182           hostPort: {{ .Values.manager.http.hostPort }}
183           {{- end}}
184           protocol: TCP
185         {{- end }}
186         {{- if .Values.manager.tls.enabled }}
187         - name: manager-tls
188           containerPort: {{ .Values.manager.tls.containerPort }}
189           {{- if .Values.manager.tls.hostPort }}
190           hostPort: {{ .Values.manager.tls.hostPort }}
191           {{- end}}
192           protocol: TCP
193         {{- end }}
194         {{- if .Values.portal.http.enabled }}
195         - name: portal
196           containerPort: {{ .Values.portal.http.containerPort }}
197           {{- if .Values.portal.http.hostPort }}
198           hostPort: {{ .Values.portal.http.hostPort }}
199           {{- end}}
200           protocol: TCP
201         {{- end }}
202         {{- if .Values.portal.tls.enabled }}
203         - name: portal-tls
204           containerPort: {{ .Values.portal.tls.containerPort }}
205           {{- if .Values.portal.tls.hostPort }}
206           hostPort: {{ .Values.portal.tls.hostPort }}
207           {{- end}}
208           protocol: TCP
209         {{- end }}
210         {{- if .Values.portalapi.http.enabled }}
211         - name: portalapi
212           containerPort: {{ .Values.portalapi.http.containerPort }}
213           {{- if .Values.portalapi.http.hostPort }}
214           hostPort: {{ .Values.portalapi.http.hostPort }}
215           {{- end}}
216           protocol: TCP
217         {{- end }}
218         {{- if .Values.portalapi.tls.enabled }}
219         - name: portalapi-tls
220           containerPort: {{ .Values.portalapi.tls.containerPort }}
221           {{- if .Values.portalapi.tls.hostPort }}
222           hostPort: {{ .Values.portalapi.tls.hostPort }}
223           {{- end}}
224           protocol: TCP
225         {{- end }}
226         {{- end }}
227         readinessProbe:
228 {{ toYaml .Values.readinessProbe | indent 10 }}
229         livenessProbe:
230 {{ toYaml .Values.livenessProbe | indent 10 }}
231         resources:
232 {{ toYaml .Values.resources | indent 10 }}
233     {{- if .Values.affinity }}
234       affinity:
235 {{ toYaml .Values.affinity | indent 8 }}
236     {{- end }}
237     {{- if .Values.nodeSelector }}
238       nodeSelector:
239 {{ toYaml .Values.nodeSelector | indent 8 }}
240     {{- end }}
241       tolerations:
242 {{ toYaml .Values.tolerations | indent 8 }}