-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeployment-backend_test.yaml.snap
More file actions
415 lines (415 loc) · 13.8 KB
/
deployment-backend_test.yaml.snap
File metadata and controls
415 lines (415 loc) · 13.8 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
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
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
should produce a Deployment resource with minimal values:
1: |
containers:
- env:
- name: TOWER_DB_PASSWORD
valueFrom:
secretKeyRef:
key: TOWER_DB_PASSWORD
name: release-name-platform-backend
- name: TOWER_LICENSE
valueFrom:
secretKeyRef:
key: TOWER_LICENSE
name: release-name-platform-backend
- name: TOWER_JWT_SECRET
valueFrom:
secretKeyRef:
key: TOWER_JWT_SECRET
name: release-name-platform-backend
- name: TOWER_CRYPTO_SECRETKEY
valueFrom:
secretKeyRef:
key: TOWER_CRYPTO_SECRETKEY
name: release-name-platform-backend
- name: NXF_HOME
value: /var/cache/tower/
- name: NXF_PLUGINS_DIR
value: /var/cache/tower/plugins/
envFrom:
- configMapRef:
name: release-name-platform-backend
- configMapRef:
name: release-name-platform-shared-backend-cron
image: private/nf-tower-enterprise/backend:v9.9.9
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 10
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 3
name: backend
readinessProbe:
failureThreshold: 5
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 3
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 101
volumeMounts:
- mountPath: /tower.yml
name: config-volume
subPath: tower.yml
- mountPath: /var/cache/tower/
name: plugin-volume
- mountPath: /.nextflow/
name: plugin-volume
- mountPath: /?/.nextflow/
name: plugin-volume
initContainers:
- command:
- sh
- -c
- |
echo "$(date): starting check for db $DB_HOST:$DB_PORT"
until mysql -h "$DB_HOST" -P "$DB_PORT" -D "$DB_NAME" -u"$DB_USERNAME" -p"$TOWER_DB_PASSWORD" -e "SELECT VERSION()"; do
echo "$(date): see you in $SLEEP_PERIOD_SECONDS seconds"
sleep $SLEEP_PERIOD_SECONDS
done
echo "$(date): db server ready"
env:
- name: SLEEP_PERIOD_SECONDS
value: "5"
- name: DB_HOST
value: ""
- name: DB_PORT
value: "3306"
- name: DB_NAME
value: null
- name: DB_USERNAME
value: ""
envFrom:
- secretRef:
name: release-name-platform-backend
image: mysql:9
imagePullPolicy: IfNotPresent
name: wait-for-db
resources:
limits:
memory: 100Mi
requests:
cpu: "0.5"
memory: 50Mi
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 101
- command:
- sh
- -c
- |
echo "$(date): starting check redis host '$REDIS_URI' with password (if set) '$REDISCLI_AUTH'";
until redis-cli -u "$REDIS_URI" get hello; do
echo "$(date): see you in $SLEEP_PERIOD_SECONDS seconds"
sleep $SLEEP_PERIOD_SECONDS
done
echo "$(date): redis server ready"
env:
- name: SLEEP_PERIOD_SECONDS
value: "5"
- name: REDIS_URI
value: redis://:6379
image: redis:7
imagePullPolicy: IfNotPresent
name: wait-for-redis
resources:
limits:
memory: 100Mi
requests:
cpu: "0.5"
memory: 50Mi
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 101
- command:
- sh
- -c
- |
echo "$(date): starting check for cron to be ready at \"${CRON_HOST}:${CRON_PORT}/health\""
until curl -s ${CRON_HOST}:${CRON_PORT}/health |grep -q \"UP\"; do
echo "$(date): see you in $SLEEP_PERIOD_SECONDS seconds"
sleep $SLEEP_PERIOD_SECONDS
done
echo "$(date): cron ready"
env:
- name: SLEEP_PERIOD_SECONDS
value: "5"
- name: CRON_HOST
value: release-name-platform-cron
- name: CRON_PORT
value: "8080"
image: curlimages/curl:latest
imagePullPolicy: IfNotPresent
name: wait-for-cron
resources:
limits:
memory: 100Mi
requests:
cpu: "0.5"
memory: 50Mi
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 101
securityContext:
fsGroup: 101
serviceAccountName: release-name-platform-sa
volumes:
- configMap:
name: release-name-platform-tower-yml
name: config-volume
- emptyDir:
sizeLimit: 1Gi
name: plugin-volume
should render the backend deployment with the correct checksums, labels and annotations:
1: |
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
common-annotation-key: common-annotation-value
labels:
app.kubernetes.io/component: backend
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: platform
app.kubernetes.io/version: 9.9.9
helm.sh/chart: platform-9.9.9_test
key123: this-should-be-overridden-in-pod-labels
key456: this-should-not-be-overridden
key789: "8080"
name: release-name-platform-backend
namespace: NAMESPACE
spec:
replicas: 3
selector:
matchLabels:
app.kubernetes.io/component: backend
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/name: platform
template:
metadata:
annotations:
checksum/configmap: 380b749392f400fe4829101e8a4fc5f15e4f13cfe8e24c4ba4bd8082b141b596
checksum/secret: 27e0ae5efe3beffdc19e0c47ecc973b5ecff8679033f1ea6ca92a640a4f46fdf
common-annotation-key: common-annotation-value
pod-annotation-key: pod-annotation-value
pod-annotation-key2: "8080"
labels:
app.kubernetes.io/component: backend
app.kubernetes.io/instance: RELEASE-NAME
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: platform
app.kubernetes.io/version: 9.9.9
helm.sh/chart: platform-9.9.9_test
key123: this-overrides-the-commonLabels
key456: this-should-not-be-overridden
key789: "8080"
spec:
containers:
- env:
- name: TOWER_DB_PASSWORD
valueFrom:
secretKeyRef:
key: db-password-key
name: unittest
- name: TOWER_LICENSE
valueFrom:
secretKeyRef:
key: license-token-key
name: unittest
- name: TOWER_JWT_SECRET
valueFrom:
secretKeyRef:
key: TOWER_JWT_SECRET
name: release-name-platform-backend
- name: TOWER_CRYPTO_SECRETKEY
valueFrom:
secretKeyRef:
key: TOWER_CRYPTO_SECRETKEY
name: release-name-platform-backend
- name: NXF_HOME
value: /var/cache/tower/
- name: NXF_PLUGINS_DIR
value: /var/cache/tower/plugins/
envFrom:
- configMapRef:
name: release-name-platform-backend
- configMapRef:
name: release-name-platform-shared-backend-cron
image: private/nf-tower-enterprise/backend:9.9.9
imagePullPolicy: IfNotPresent
livenessProbe:
failureThreshold: 10
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 3
name: backend
readinessProbe:
failureThreshold: 5
httpGet:
path: /health
port: 8080
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 3
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 101
volumeMounts:
- mountPath: /tower.yml
name: config-volume
subPath: tower.yml
- mountPath: /var/cache/tower/
name: plugin-volume
- mountPath: /.nextflow/
name: plugin-volume
- mountPath: /?/.nextflow/
name: plugin-volume
initContainers:
- command:
- sh
- -c
- |
echo "$(date): starting check for db $DB_HOST:$DB_PORT"
until mysql -h "$DB_HOST" -P "$DB_PORT" -D "$DB_NAME" -u"$DB_USERNAME" -p"$TOWER_DB_PASSWORD" -e "SELECT VERSION()"; do
echo "$(date): see you in $SLEEP_PERIOD_SECONDS seconds"
sleep $SLEEP_PERIOD_SECONDS
done
echo "$(date): db server ready"
env:
- name: SLEEP_PERIOD_SECONDS
value: "5"
- name: DB_HOST
value: ""
- name: DB_PORT
value: "3306"
- name: DB_NAME
value: null
- name: DB_USERNAME
value: ""
envFrom:
- secretRef:
name: release-name-platform-backend
image: mysql:9
imagePullPolicy: IfNotPresent
name: wait-for-db
resources:
limits:
memory: 100Mi
requests:
cpu: "0.5"
memory: 50Mi
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 101
- command:
- sh
- -c
- |
echo "$(date): starting check redis host '$REDIS_URI' with password (if set) '$REDISCLI_AUTH'";
until redis-cli -u "$REDIS_URI" get hello; do
echo "$(date): see you in $SLEEP_PERIOD_SECONDS seconds"
sleep $SLEEP_PERIOD_SECONDS
done
echo "$(date): redis server ready"
env:
- name: SLEEP_PERIOD_SECONDS
value: "5"
- name: REDIS_URI
value: redis://:6379
image: redis:7
imagePullPolicy: IfNotPresent
name: wait-for-redis
resources:
limits:
memory: 100Mi
requests:
cpu: "0.5"
memory: 50Mi
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 101
- command:
- sh
- -c
- |
echo "$(date): starting check for cron to be ready at \"${CRON_HOST}:${CRON_PORT}/health\""
until curl -s ${CRON_HOST}:${CRON_PORT}/health |grep -q \"UP\"; do
echo "$(date): see you in $SLEEP_PERIOD_SECONDS seconds"
sleep $SLEEP_PERIOD_SECONDS
done
echo "$(date): cron ready"
env:
- name: SLEEP_PERIOD_SECONDS
value: "5"
- name: CRON_HOST
value: release-name-platform-cron
- name: CRON_PORT
value: "8080"
image: curlimages/curl:latest
imagePullPolicy: IfNotPresent
name: wait-for-cron
resources:
limits:
memory: 100Mi
requests:
cpu: "0.5"
memory: 50Mi
securityContext:
capabilities:
drop:
- ALL
readOnlyRootFilesystem: true
runAsNonRoot: true
runAsUser: 101
securityContext:
fsGroup: 101
serviceAccountName: release-name-platform-sa
volumes:
- configMap:
name: release-name-platform-tower-yml
name: config-volume
- emptyDir:
sizeLimit: 1Gi
name: plugin-volume