-
Notifications
You must be signed in to change notification settings - Fork 143
/
Copy pathdeployment.yaml
318 lines (318 loc) · 14.8 KB
/
deployment.yaml
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
{{- if .Values.optimize.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "optimize.fullname" . }}
labels:
{{- include "optimize.labels" . | nindent 4 }}
annotations:
{{- toYaml .Values.global.annotations | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "optimize.matchLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "optimize.labels" . | nindent 8 }}
{{- if .Values.optimize.podLabels }}
{{- toYaml .Values.optimize.podLabels | nindent 8 }}
{{- end }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/optimize/configmap.yaml") . | sha256sum }}
{{- if .Values.optimize.podAnnotations }}
{{- toYaml .Values.optimize.podAnnotations | nindent 8 }}
{{- end }}
spec:
imagePullSecrets:
{{- include "optimize.imagePullSecrets" . | nindent 8 }}
initContainers:
{{- if .Values.optimize.initContainers }}
{{- tpl (.Values.optimize.initContainers | toYaml | nindent 8) $ }}
{{- end }}
{{- if .Values.optimize.migration.enabled }}
- name: migration
image: {{ include "camundaPlatform.imageByParams" (dict "base" .Values.global "overlay" .Values.optimize) }}
command: ['./upgrade/upgrade.sh', '--skip-warning']
{{- if .Values.optimize.containerSecurityContext }}
securityContext: {{- toYaml .Values.optimize.containerSecurityContext | nindent 12 }}
{{- end }}
env:
{{- if .Values.global.elasticsearch.external }}
- name: CAMUNDA_OPTIMIZE_ELASTICSEARCH_SECURITY_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "elasticsearch.authExistingSecret" . | quote }}
key: {{ include "elasticsearch.authExistingSecretKey" . | quote }}
{{- end }}
{{- if .Values.global.opensearch.enabled }}
{{- if eq .Values.global.opensearch.url.protocol "https" }}
- name: CAMUNDA_OPTIMIZE_OPENSEARCH_SSL_ENABLED
value: "true"
{{- end }}
- name: CAMUNDA_OPTIMIZE_DATABASE
value: opensearch
- name: CAMUNDA_OPTIMIZE_OPENSEARCH_HTTP_PORT
value: {{ .Values.global.opensearch.url.port | quote }}
- name: CAMUNDA_OPTIMIZE_OPENSEARCH_HOST
value: {{ include "camundaPlatform.opensearchHost" . | quote }}
- name: CAMUNDA_OPTIMIZE_OPENSEARCH_SECURITY_USERNAME
value: {{ .Values.global.opensearch.auth.username | quote }}
{{- if .Values.global.opensearch.auth.password}}
- name: CAMUNDA_OPTIMIZE_OPENSEARCH_SECURITY_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "opensearch.authExistingSecret" . | quote }}
key: {{ include "opensearch.authExistingSecretKey" . | quote }}
{{- end}}
{{- end }}
{{- if or .Values.global.elasticsearch.tls.existingSecret .Values.global.opensearch.tls.existingSecret }}
- name: JAVA_TOOL_OPTIONS
value: -Djavax.net.ssl.trustStore=/optimize/certificates/externaldb.jks
{{- end }}
{{- if .Values.global.elasticsearch.enabled }}
- name: OPTIMIZE_ELASTICSEARCH_HOST
value: {{ include "camundaPlatform.elasticsearchHost" . | quote }}
- name: OPTIMIZE_ELASTICSEARCH_HTTP_PORT
value: {{ .Values.global.elasticsearch.url.port | quote }}
{{- end }}
{{- with .Values.optimize.migration.env }}
{{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.optimize.migration.resources | nindent 12 }}
volumeMounts:
- mountPath: /tmp
name: tmp
- mountPath: /camunda
name: camunda
- mountPath: /optimize/config/environment-config.yaml
subPath: environment-config.yaml
name: environment-config
{{- if .Values.global.identity.auth.enabled }}
- mountPath: /optimize/config/application-ccsm.yaml
subPath: application-ccsm.yaml
name: environment-config
{{- end }}
{{- range $key, $val := .Values.optimize.extraConfiguration }}
- name: environment-config
mountPath: /optimize/config/{{ $key }}
subPath: {{ $key }}
{{- end }}
{{- if or .Values.global.elasticsearch.tls.existingSecret .Values.global.opensearch.tls.existingSecret }}
- name: keystore
mountPath: /optimize/certificates/externaldb.jks
subPath: externaldb.jks
{{- end }}
{{- if .Values.optimize.extraVolumeMounts }}
{{- .Values.optimize.extraVolumeMounts | toYaml | nindent 12 }}
{{- end }}
{{- end }}
containers:
- name: optimize
image: {{ include "camundaPlatform.imageByParams" (dict "base" .Values.global "overlay" .Values.optimize) }}
imagePullPolicy: {{ .Values.global.image.pullPolicy }}
{{- if .Values.optimize.containerSecurityContext }}
securityContext: {{- toYaml .Values.optimize.containerSecurityContext | nindent 12 }}
{{- end }}
env:
{{- if .Values.global.elasticsearch.external }}
- name: CAMUNDA_OPTIMIZE_ELASTICSEARCH_SECURITY_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "elasticsearch.authExistingSecret" . | quote }}
key: {{ include "elasticsearch.authExistingSecretKey" . | quote }}
{{- end }}
{{- if .Values.global.opensearch.enabled }}
{{- if eq .Values.global.opensearch.url.protocol "https" }}
- name: CAMUNDA_OPTIMIZE_OPENSEARCH_SSL_ENABLED
value: "true"
{{- end }}
- name: CAMUNDA_OPTIMIZE_DATABASE
value: opensearch
- name: CAMUNDA_OPTIMIZE_OPENSEARCH_HTTP_PORT
value: {{ .Values.global.opensearch.url.port | quote }}
- name: CAMUNDA_OPTIMIZE_OPENSEARCH_HOST
value: {{ include "camundaPlatform.opensearchHost" . | quote }}
- name: CAMUNDA_OPTIMIZE_OPENSEARCH_SECURITY_USERNAME
value: {{ .Values.global.opensearch.auth.username | quote }}
{{- if .Values.global.opensearch.auth.password}}
- name: CAMUNDA_OPTIMIZE_OPENSEARCH_SECURITY_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "opensearch.authExistingSecret" . | quote }}
key: {{ include "opensearch.authExistingSecretKey" . | quote }}
{{- end}}
{{- end }}
{{- if or .Values.global.elasticsearch.tls.existingSecret .Values.global.opensearch.tls.existingSecret }}
- name: JAVA_TOOL_OPTIONS
value: -Djavax.net.ssl.trustStore=/optimize/certificates/externaldb.jks
{{- end }}
{{- if .Values.optimize.contextPath }}
- name: CAMUNDA_OPTIMIZE_CONTEXT_PATH
value: {{ .Values.optimize.contextPath | quote }}
{{- end }}
{{- if .Values.global.elasticsearch.enabled }}
- name: OPTIMIZE_ELASTICSEARCH_HOST
value: {{ include "camundaPlatform.elasticsearchHost" . | quote }}
- name: OPTIMIZE_ELASTICSEARCH_HTTP_PORT
value: {{ .Values.global.elasticsearch.url.port | quote }}
{{- end }}
- name: SPRING_PROFILES_ACTIVE
value: ccsm
{{- if .Values.global.identity.auth.enabled }}
- name: CAMUNDA_IDENTITY_CLIENT_SECRET
{{- if and .Values.global.identity.auth.optimize.existingSecret (not (typeIs "string" .Values.global.identity.auth.optimize.existingSecret)) }}
valueFrom:
secretKeyRef:
{{- /*
Helper: https://github.com/bitnami/charts/blob/master/bitnami/common/templates/_secrets.tpl
Usage in keycloak secrets https://github.com/bitnami/charts/blob/master/bitnami/keycloak/templates/secrets.yaml
and in statefulset https://github.com/bitnami/charts/blob/master/bitnami/keycloak/templates/statefulset.yaml
*/}}
name: {{ include "common.secrets.name" (dict "existingSecret" .Values.global.identity.auth.optimize.existingSecret "context" $) }}
key: optimize-secret
{{- else }}
valueFrom:
secretKeyRef:
name: {{ include "camundaPlatform.identitySecretName" (dict "context" . "component" "optimize") }}
key: optimize-secret
{{- end }}
{{- end }}
{{- if .Values.global.multitenancy.enabled }}
- name: CAMUNDA_OPTIMIZE_MULTITENANCY_ENABLED
value: "true"
- name: CAMUNDA_OPTIMIZE_CACHES_CLOUD_TENANT_AUTHORIZATIONS_MAX_SIZE
value: "10000"
- name: CAMUNDA_OPTIMIZE_CACHES_CLOUD_TENANT_AUTHORIZATIONS_MIN_FETCH_INTERVAL_SECONDS
value: "600000"
{{- end }}
{{- with .Values.optimize.env }}
{{- tpl (toYaml .) $ | nindent 12 }}
{{- end }}
{{- if .Values.global.identity.auth.enabled }}
envFrom:
- configMapRef:
name: {{ include "camundaPlatform.fullname" . }}-identity-env-vars
{{- end }}
{{- if .Values.optimize.command }}
command: {{ toYaml .Values.optimize.command | nindent 10 }}
{{- end }}
resources:
{{- toYaml .Values.optimize.resources | nindent 12 }}
ports:
- containerPort: 8090
name: http
protocol: TCP
- containerPort: 8092
name: management
protocol: TCP
{{- if .Values.optimize.startupProbe.enabled }}
startupProbe:
httpGet:
path: {{ .Values.optimize.contextPath }}{{ .Values.optimize.startupProbe.probePath }}
scheme: {{ .Values.optimize.startupProbe.scheme }}
port: http
initialDelaySeconds: {{ .Values.optimize.startupProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.optimize.startupProbe.periodSeconds }}
successThreshold: {{ .Values.optimize.startupProbe.successThreshold }}
failureThreshold: {{ .Values.optimize.startupProbe.failureThreshold }}
timeoutSeconds: {{ .Values.optimize.startupProbe.timeoutSeconds }}
{{- end }}
{{- if .Values.optimize.readinessProbe.enabled }}
readinessProbe:
httpGet:
path: {{ .Values.optimize.contextPath }}{{ .Values.optimize.readinessProbe.probePath }}
scheme: {{ .Values.optimize.readinessProbe.scheme }}
port: http
initialDelaySeconds: {{ .Values.optimize.readinessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.optimize.readinessProbe.periodSeconds }}
successThreshold: {{ .Values.optimize.readinessProbe.successThreshold }}
failureThreshold: {{ .Values.optimize.readinessProbe.failureThreshold }}
timeoutSeconds: {{ .Values.optimize.readinessProbe.timeoutSeconds }}
{{- end }}
{{- if .Values.optimize.livenessProbe.enabled }}
livenessProbe:
httpGet:
path: {{ .Values.optimize.contextPath }}{{ .Values.optimize.livenessProbe.probePath }}
scheme: {{ .Values.optimize.livenessProbe.scheme }}
port: http
initialDelaySeconds: {{ .Values.optimize.livenessProbe.initialDelaySeconds }}
periodSeconds: {{ .Values.optimize.livenessProbe.periodSeconds }}
successThreshold: {{ .Values.optimize.livenessProbe.successThreshold }}
failureThreshold: {{ .Values.optimize.livenessProbe.failureThreshold }}
timeoutSeconds: {{ .Values.optimize.livenessProbe.timeoutSeconds }}
{{- end }}
volumeMounts:
- mountPath: /tmp
name: tmp
- mountPath: /camunda
name: camunda
- mountPath: /optimize/config/environment-config.yaml
subPath: environment-config.yaml
name: environment-config
{{- if .Values.global.identity.auth.enabled }}
- mountPath: /optimize/config/application-ccsm.yaml
subPath: application-ccsm.yaml
name: environment-config
{{- end }}
{{- range $key, $val := .Values.optimize.extraConfiguration }}
- name: environment-config
mountPath: /optimize/config/{{ $key }}
subPath: {{ $key }}
{{- end }}
{{- if or .Values.global.elasticsearch.tls.existingSecret .Values.global.opensearch.tls.existingSecret }}
- name: keystore
mountPath: /optimize/certificates/externaldb.jks
subPath: externaldb.jks
{{- end }}
{{- if .Values.optimize.extraVolumeMounts }}
{{- .Values.optimize.extraVolumeMounts | toYaml | nindent 12 }}
{{- end }}
{{- if .Values.optimize.sidecars }}
{{- .Values.optimize.sidecars | toYaml | nindent 8 }}
{{- end }}
volumes:
- name: tmp
emptyDir: {}
- name: camunda
emptyDir: {}
- name: environment-config
configMap:
name: {{ include "optimize.fullname" . }}-configuration
defaultMode: {{ .Values.optimize.configMap.defaultMode }}
{{- if .Values.global.elasticsearch.tls.existingSecret }}
- name: keystore
secret:
secretName: {{ .Values.global.elasticsearch.tls.existingSecret }}
optional: false
{{- end }}
{{- if .Values.global.opensearch.tls.existingSecret }}
- name: keystore
secret:
secretName: {{ .Values.global.opensearch.tls.existingSecret }}
optional: false
{{- end }}
{{- if .Values.optimize.extraVolumes }}
{{- .Values.optimize.extraVolumes | toYaml | nindent 8 }}
{{- end }}
{{- if .Values.optimize.serviceAccount.name }}
serviceAccountName: {{ .Values.optimize.serviceAccount.name }}
{{- end }}
{{- if .Values.optimize.podSecurityContext }}
securityContext: {{- toYaml .Values.optimize.podSecurityContext | nindent 8 }}
{{- end }}
{{- with .Values.optimize.nodeSelector }}
nodeSelector:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.optimize.affinity }}
affinity:
{{ toYaml . | indent 8 }}
{{- end }}
{{- with .Values.optimize.tolerations }}
tolerations:
{{ toYaml . | indent 8 }}
{{- end }}
{{- end }}