Skip to content

Commit 35c1dc8

Browse files
committed
allow custom annotations for all pods
1 parent 2e2efe8 commit 35c1dc8

File tree

4 files changed

+38
-6
lines changed

4 files changed

+38
-6
lines changed

templates/_helpers.tpl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,13 @@ Create the name of the stackstorm-ha service account to use
105105
{{- end }}
106106
{{- end -}}
107107

108+
# Reusable annotations list
109+
{{- define "custom-annotations" -}}
110+
{{- if .annotations }}
111+
{{ toYaml .annotations }}
112+
{{- end }}
113+
{{- end -}}
114+
108115
# For custom st2packs-Container reduce duplicity by defining it here once
109116
{{- define "packs-volumes" -}}
110117
{{- if .Values.st2.packs.images }}

templates/deployments.yaml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ spec:
3535
annotations:
3636
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
3737
checksum/auth: {{ include (print $.Template.BasePath "/secrets_st2auth.yaml") . | sha256sum }}
38+
{{ include "custom-annotations" .Values.st2auth | indent 8 }}
3839
spec:
3940
imagePullSecrets:
4041
{{- if .Values.image.pullSecret }}
@@ -145,6 +146,7 @@ spec:
145146
annotations:
146147
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
147148
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
149+
{{ include "custom-annotations" .Values.st2api | indent 8 }}
148150
spec:
149151
imagePullSecrets:
150152
{{- if .Values.image.pullSecret }}
@@ -255,6 +257,7 @@ spec:
255257
heritage: {{ .Release.Service }}
256258
annotations:
257259
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
260+
{{ include "custom-annotations" .Values.st2stream | indent 8 }}
258261
spec:
259262
imagePullSecrets:
260263
{{- if .Values.image.pullSecret }}
@@ -333,6 +336,7 @@ spec:
333336
heritage: {{ .Release.Service }}
334337
annotations:
335338
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2web.yaml") . | sha256sum }}
339+
{{ include "custom-annotations" .Values.st2web | indent 8 }}
336340
spec:
337341
imagePullSecrets:
338342
{{- if .Values.image.pullSecret }}
@@ -431,6 +435,7 @@ spec:
431435
heritage: {{ .Release.Service }}
432436
annotations:
433437
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
438+
{{ include "custom-annotations" .Values.st2rulesengine | indent 8 }}
434439
spec:
435440
imagePullSecrets:
436441
{{- if .Values.image.pullSecret }}
@@ -518,6 +523,7 @@ spec:
518523
heritage: {{ .Release.Service }}
519524
annotations:
520525
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
526+
{{ include "custom-annotations" .Values.st2timersengine | indent 8 }}
521527
spec:
522528
imagePullSecrets:
523529
{{- if .Values.image.pullSecret }}
@@ -597,6 +603,7 @@ spec:
597603
annotations:
598604
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
599605
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
606+
{{ include "custom-annotations" .Values.st2workflowengine | indent 8 }}
600607
spec:
601608
imagePullSecrets:
602609
{{- if .Values.image.pullSecret }}
@@ -688,6 +695,7 @@ spec:
688695
annotations:
689696
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
690697
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
698+
{{ include "custom-annotations" .Values.st2scheduler | indent 8 }}
691699
spec:
692700
imagePullSecrets:
693701
{{- if .Values.image.pullSecret }}
@@ -779,6 +787,7 @@ spec:
779787
heritage: {{ .Release.Service }}
780788
annotations:
781789
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
790+
{{ include "custom-annotations" .Values.st2notifier | indent 8 }}
782791
spec:
783792
imagePullSecrets:
784793
{{- if .Values.image.pullSecret }}
@@ -862,9 +871,7 @@ spec:
862871
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") $ | sha256sum }}
863872
checksum/packs: {{ include (print $.Template.BasePath "/configmaps_packs.yaml") $ | sha256sum }}
864873
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") $ | sha256sum }}
865-
{{- if .annotations }}
866-
{{ toYaml .annotations | indent 8 }}
867-
{{- end }}
874+
{{ include "custom-annotations" . | indent 8 }}
868875
spec:
869876
imagePullSecrets:
870877
{{- if $.Values.image.pullSecret }}
@@ -992,9 +999,7 @@ spec:
992999
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
9931000
checksum/ssh: {{ include (print $.Template.BasePath "/secrets_ssh.yaml") . | sha256sum }}
9941001
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
995-
{{- if .Values.st2actionrunner.annotations }}
996-
{{ toYaml .Values.st2actionrunner.annotations | indent 8 }}
997-
{{- end }}
1002+
{{ include "custom-annotations" .Values.st2actionrunner | indent 8 }}
9981003
spec:
9991004
{{- if .Values.st2actionrunner.hostAliases }}
10001005
hostAliases:
@@ -1118,6 +1123,7 @@ spec:
11181123
heritage: {{ .Release.Service }}
11191124
annotations:
11201125
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
1126+
{{ include "custom-annotations" .Values.st2garbagecollector | indent 8 }}
11211127
spec:
11221128
imagePullSecrets:
11231129
{{- if .Values.image.pullSecret }}
@@ -1199,6 +1205,7 @@ spec:
11991205
checksum/auth: {{ include (print $.Template.BasePath "/secrets_st2auth.yaml") . | sha256sum }}
12001206
checksum/ssh: {{ include (print $.Template.BasePath "/secrets_ssh.yaml") . | sha256sum }}
12011207
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
1208+
{{ include "custom-annotations" .Values.st2client | indent 8 }}
12021209
spec:
12031210
imagePullSecrets:
12041211
{{- if .Values.st2.packs.images }}
@@ -1367,6 +1374,7 @@ spec:
13671374
heritage: {{ .Release.Service }}
13681375
annotations:
13691376
checksum/chatops: {{ include (print $.Template.BasePath "/secrets_st2chatops.yaml") . | sha256sum }}
1377+
{{ include "custom-annotations" .Values.st2chatops | indent 8 }}
13701378
spec:
13711379
{{- if .Values.image.pullSecret }}
13721380
imagePullSecrets:

templates/jobs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ spec:
5858
mountPath: /opt/stackstorm/rbac/assignments/
5959
- name: st2-rbac-mappings-vol
6060
mountPath: /opt/stackstorm/rbac/mappings/
61+
{{ include "custom-annotations" .Values.jobs | indent 8 }}
6162
# TODO: Find out default resource limits for this specific service (#5)
6263
#resources:
6364
volumes:
@@ -172,6 +173,7 @@ spec:
172173
- name: st2-apikeys-vol
173174
mountPath: /etc/st2/apikeys.yaml
174175
subPath: apikeys.yaml
176+
{{ include "custom-annotations" .Values.jobs | indent 8 }}
175177
# TODO: Find out default resource limits for this specific service (#5)
176178
#resources:
177179
volumes:
@@ -276,6 +278,7 @@ spec:
276278
- name: st2-kv-vol
277279
mountPath: /etc/st2/st2kv.yaml
278280
subPath: st2kv.yaml
281+
{{ include "custom-annotations" .Values.jobs | indent 8 }}
279282
# TODO: Find out default resource limits for this specific service (#5)
280283
#resources:
281284
volumes:
@@ -360,6 +363,7 @@ spec:
360363
- name: st2-virtualenvs-vol
361364
mountPath: /opt/stackstorm/virtualenvs/
362365
{{- end }}
366+
{{ include "custom-annotations" .Values.jobs | indent 8 }}
363367
# TODO: Find out default resource limits for this specific service (#5)
364368
#resources:
365369
volumes:

values.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ st2web:
242242
cpu: "50m"
243243
limits:
244244
memory: "100Mi"
245+
annotations: {}
245246
# Override default image settings (for now, only tag can be overridden)
246247
image: {}
247248
## Note that Helm templating is supported in this block!
@@ -274,6 +275,7 @@ st2auth:
274275
requests:
275276
memory: "85Mi"
276277
cpu: "50m"
278+
annotations: {}
277279
# Override default image settings (for now, only tag can be overridden)
278280
image: {}
279281
## Note that Helm templating is supported in this block!
@@ -292,6 +294,7 @@ st2api:
292294
requests:
293295
memory: "150Mi"
294296
cpu: "25m"
297+
annotations: {}
295298
# Override default image settings (for now, only tag can be overridden)
296299
image: {}
297300
## Note that Helm templating is supported in this block!
@@ -310,6 +313,7 @@ st2stream:
310313
requests:
311314
memory: "100Mi"
312315
cpu: "50m"
316+
annotations: {}
313317
# Override default image settings (for now, only tag can be overridden)
314318
image: {}
315319
## Note that Helm templating is supported in this block!
@@ -328,6 +332,7 @@ st2rulesengine:
328332
requests:
329333
memory: "75Mi"
330334
cpu: "25m"
335+
annotations: {}
331336
# Override default image settings (for now, only tag can be overridden)
332337
image: {}
333338
## Note that Helm templating is supported in this block!
@@ -345,6 +350,7 @@ st2timersengine:
345350
requests:
346351
memory: "75Mi"
347352
cpu: "10m"
353+
annotations: {}
348354
# Override default image settings (for now, only tag can be overridden)
349355
image: {}
350356
## Note that Helm templating is supported in this block!
@@ -363,6 +369,7 @@ st2workflowengine:
363369
requests:
364370
memory: "200Mi"
365371
cpu: "100m"
372+
annotations: {}
366373
# Override default image settings (for now, only tag can be overridden)
367374
image: {}
368375
## Note that Helm templating is supported in this block!
@@ -381,6 +388,7 @@ st2scheduler:
381388
requests:
382389
memory: "75Mi"
383390
cpu: "50m"
391+
annotations: {}
384392
# Override default image settings (for now, only tag can be overridden)
385393
image: {}
386394
## Note that Helm templating is supported in this block!
@@ -399,6 +407,7 @@ st2notifier:
399407
requests:
400408
memory: "75Mi"
401409
cpu: "50m"
410+
annotations: {}
402411
# Override default image settings (for now, only tag can be overridden)
403412
image: {}
404413
## Note that Helm templating is supported in this block!
@@ -442,6 +451,7 @@ st2actionrunner:
442451
# The st2client deployment/pod simplifies ad-hoc administration.
443452
# st2client is a special purpose actionrunner pod, but you can customize it separately
444453
st2client:
454+
annotations: {}
445455
# Override default image settings (for now, only tag can be overridden)
446456
image: {}
447457
## Note that Helm templating is supported in this block!
@@ -457,6 +467,7 @@ st2garbagecollector:
457467
requests:
458468
memory: "80Mi"
459469
cpu: "10m"
470+
annotations: {}
460471
# Override default image settings (for now, only tag can be overridden)
461472
image: {}
462473
## Note that Helm templating is supported in this block!
@@ -498,6 +509,7 @@ st2chatops:
498509
requests:
499510
memory: "50Mi"
500511
cpu: "5m"
512+
annotations: {}
501513
# Additional advanced settings to control pod/deployment placement
502514
nodeSelector: {}
503515
tolerations: []
@@ -509,6 +521,7 @@ st2chatops:
509521
## Various batch jobs (apply-rbac-definitions, apikey-load, key-load, register-content)
510522
##
511523
jobs:
524+
annotations: {}
512525
# Override default image settings (for now, only tag can be overridden)
513526
image: {}
514527
## Note that Helm templating is supported in this block!

0 commit comments

Comments
 (0)