Skip to content

Commit aa95c1a

Browse files
authored
Merge pull request #195 from cognifloyd/annotations
Allow custom annotations on all pods
2 parents 2e2efe8 + 72e29f9 commit aa95c1a

File tree

5 files changed

+64
-2
lines changed

5 files changed

+64
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
* Reformat some yaml strings so that single quotes wrap strings that include double quotes (#194) (by @cognifloyd)
88
* st2chatops change: If `st2chatops.env.ST2_API_KEY` is defined, do not set `ST2_AUTH_USERNAME` or `ST2_AUTH_PASSWORD` env vars any more. (#197) (by @cognifloyd)
99
* Add image.tag overrides for all deployments. (#200) (by @cognifloyd)
10+
* If your k8s cluster admin requires custom annotations (eg: to indicate mongo or rabbitmq usage), you can now add those to each set of pods. (#195) (by @cognifloyd)
1011

1112
## v0.60.0
1213
* Switch st2 version to `v3.5dev` as a new latest development version (#187)

templates/deployments.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ 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+
{{- if .Values.st2auth.annotations }}
39+
{{ toYaml .Values.st2auth.annotations | indent 8 }}
40+
{{- end }}
3841
spec:
3942
imagePullSecrets:
4043
{{- if .Values.image.pullSecret }}
@@ -145,6 +148,9 @@ spec:
145148
annotations:
146149
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
147150
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
151+
{{- if .Values.st2api.annotations }}
152+
{{ toYaml .Values.st2api.annotations | indent 8 }}
153+
{{- end }}
148154
spec:
149155
imagePullSecrets:
150156
{{- if .Values.image.pullSecret }}
@@ -255,6 +261,9 @@ spec:
255261
heritage: {{ .Release.Service }}
256262
annotations:
257263
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
264+
{{- if .Values.st2stream.annotations }}
265+
{{ toYaml .Values.st2stream.annotations | indent 8 }}
266+
{{- end }}
258267
spec:
259268
imagePullSecrets:
260269
{{- if .Values.image.pullSecret }}
@@ -333,6 +342,9 @@ spec:
333342
heritage: {{ .Release.Service }}
334343
annotations:
335344
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2web.yaml") . | sha256sum }}
345+
{{- if .Values.st2web.annotations }}
346+
{{ toYaml .Values.st2web.annotations | indent 8 }}
347+
{{- end }}
336348
spec:
337349
imagePullSecrets:
338350
{{- if .Values.image.pullSecret }}
@@ -431,6 +443,9 @@ spec:
431443
heritage: {{ .Release.Service }}
432444
annotations:
433445
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
446+
{{- if .Values.st2rulesengine.annotations }}
447+
{{ toYaml .Values.st2rulesengine.annotations | indent 8 }}
448+
{{- end }}
434449
spec:
435450
imagePullSecrets:
436451
{{- if .Values.image.pullSecret }}
@@ -518,6 +533,9 @@ spec:
518533
heritage: {{ .Release.Service }}
519534
annotations:
520535
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
536+
{{- if .Values.st2timersengine.annotations }}
537+
{{ toYaml .Values.st2timersengine.annotations | indent 8 }}
538+
{{- end }}
521539
spec:
522540
imagePullSecrets:
523541
{{- if .Values.image.pullSecret }}
@@ -597,6 +615,9 @@ spec:
597615
annotations:
598616
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
599617
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
618+
{{- if .Values.st2workflowengine.annotations }}
619+
{{ toYaml .Values.st2workflowengine.annotations | indent 8 }}
620+
{{- end }}
600621
spec:
601622
imagePullSecrets:
602623
{{- if .Values.image.pullSecret }}
@@ -688,6 +709,9 @@ spec:
688709
annotations:
689710
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
690711
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
712+
{{- if .Values.st2scheduler.annotations }}
713+
{{ toYaml .Values.st2scheduler.annotations | indent 8 }}
714+
{{- end }}
691715
spec:
692716
imagePullSecrets:
693717
{{- if .Values.image.pullSecret }}
@@ -779,6 +803,9 @@ spec:
779803
heritage: {{ .Release.Service }}
780804
annotations:
781805
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
806+
{{- if .Values.st2notifier.annotations }}
807+
{{ toYaml .Values.st2notifier.annotations | indent 8 }}
808+
{{- end }}
782809
spec:
783810
imagePullSecrets:
784811
{{- if .Values.image.pullSecret }}
@@ -1118,6 +1145,9 @@ spec:
11181145
heritage: {{ .Release.Service }}
11191146
annotations:
11201147
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
1148+
{{- if .Values.st2garbagecollector.annotations }}
1149+
{{ toYaml .Values.st2garbagecollector.annotations | indent 8 }}
1150+
{{- end }}
11211151
spec:
11221152
imagePullSecrets:
11231153
{{- if .Values.image.pullSecret }}
@@ -1199,6 +1229,9 @@ spec:
11991229
checksum/auth: {{ include (print $.Template.BasePath "/secrets_st2auth.yaml") . | sha256sum }}
12001230
checksum/ssh: {{ include (print $.Template.BasePath "/secrets_ssh.yaml") . | sha256sum }}
12011231
checksum/datastore-key: {{ include (print $.Template.BasePath "/secrets_datastore_crypto_key.yaml") . | sha256sum }}
1232+
{{- if .Values.st2client.annotations }}
1233+
{{ toYaml .Values.st2client.annotations | indent 8 }}
1234+
{{- end }}
12021235
spec:
12031236
imagePullSecrets:
12041237
{{- if .Values.st2.packs.images }}
@@ -1367,6 +1400,9 @@ spec:
13671400
heritage: {{ .Release.Service }}
13681401
annotations:
13691402
checksum/chatops: {{ include (print $.Template.BasePath "/secrets_st2chatops.yaml") . | sha256sum }}
1403+
{{- if .Values.st2chatops.annotations }}
1404+
{{ toYaml .Values.st2chatops.annotations | indent 8 }}
1405+
{{- end }}
13701406
spec:
13711407
{{- if .Values.image.pullSecret }}
13721408
imagePullSecrets:

templates/ingress.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ metadata:
1515
{{- if .Values.ingress.tls }}
1616
ingress.kubernetes.io/secure-backends: "true"
1717
{{- end }}
18-
{{- range $key, $value := .Values.ingress.annotations }}
19-
{{ $key }}: {{ $value | quote }}
18+
{{- if .Values.ingress.annotations }}
19+
{{ toYaml .Values.ingress.annotations | indent 4 }}
2020
{{- end }}
2121
spec:
2222
rules:

templates/jobs.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ spec:
3030
# TODO: Investigate/propose running Helm hook only on condition when ConfigMap or Secret has changed
3131
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
3232
checksum/rbac: {{ include (print $.Template.BasePath "/configmaps_rbac.yaml") . | sha256sum }}
33+
{{- if .Values.jobs.annotations }}
34+
{{ toYaml .Values.jobs.annotations | indent 8 }}
35+
{{- end }}
3336
spec:
3437
imagePullSecrets:
3538
{{- if .Values.image.pullSecret }}
@@ -107,6 +110,9 @@ spec:
107110
# TODO: Investigate/propose running Helm hook only on condition when ConfigMap or Secret has changed
108111
checksum/urls: {{ include (print $.Template.BasePath "/configmaps_st2-urls.yaml") . | sha256sum }}
109112
checksum/apikeys: {{ include (print $.Template.BasePath "/secrets_st2apikeys.yaml") . | sha256sum }}
113+
{{- if .Values.jobs.annotations }}
114+
{{ toYaml .Values.jobs.annotations | indent 8 }}
115+
{{- end }}
110116
spec:
111117
imagePullSecrets:
112118
{{- if .Values.image.pullSecret }}
@@ -214,6 +220,9 @@ spec:
214220
# TODO: Investigate/propose running Helm hook only on condition when ConfigMap or Secret has changed
215221
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
216222
checksum/urls: {{ include (print $.Template.BasePath "/configmaps_st2-urls.yaml") . | sha256sum }}
223+
{{- if .Values.jobs.annotations }}
224+
{{ toYaml .Values.jobs.annotations | indent 8 }}
225+
{{- end }}
217226
spec:
218227
imagePullSecrets:
219228
{{- if .Values.image.pullSecret }}
@@ -321,6 +330,9 @@ spec:
321330
# TODO: Investigate/propose running Helm hook only on condition when ConfigMap or Secret has changed
322331
checksum/config: {{ include (print $.Template.BasePath "/configmaps_st2-conf.yaml") . | sha256sum }}
323332
checksum/packs: {{ include (print $.Template.BasePath "/configmaps_packs.yaml") . | sha256sum }}
333+
{{- if .Values.jobs.annotations }}
334+
{{ toYaml .Values.jobs.annotations | indent 8 }}
335+
{{- end }}
324336
spec:
325337
imagePullSecrets:
326338
{{- if .Values.image.pullSecret }}

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)