Skip to content

Commit 87295be

Browse files
authored
Merge pull request #270 from cognifloyd/deployment-annotations
apply annotations to deployments and jobs, not just pods
2 parents c832db4 + 943db16 commit 87295be

File tree

3 files changed

+55
-0
lines changed

3 files changed

+55
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* Template `~/.st2/config`. This allows customizing the settings used by the `st2client` and jobs pods for using the st2 apis. (#262) (by @cognifloyd)
1616
* Fix indent for lifecycle postStart hook of `st2web` pod. (#268) (by @cognifloyd)
1717
* Advanced Feature: Allow `st2web` to serve HTTPS when the ssl certs are provided via `st2web.extra_volumes`. To enable this, add `ST2WEB_HTTPS: "1"` to `st2web.env` in your values file. (#264) (by @cognifloyd)
18+
* Custom annotations now apply to deployments and jobs, not just pods. (#270) (by @cognifloyd)
1819

1920
## v0.70.0
2021
* New feature: Shared packs volumes `st2.packs.volumes`. Allow using cluster-specific persistent volumes to store packs, virtualenvs, and (optionally) configs. This enables using `st2 pack install`. It even works with `st2packs` images in `st2.packs.images`. (#199) (by @cognifloyd)

templates/deployments.yaml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ metadata:
2020
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
2121
release: {{ .Release.Name }}
2222
heritage: {{ .Release.Service }}
23+
{{- if .Values.st2auth.annotations }}
24+
annotations: {{- toYaml .Values.st2auth.annotations | nindent 4 }}
25+
{{- end }}
2326
spec:
2427
selector:
2528
matchLabels:
@@ -141,6 +144,9 @@ metadata:
141144
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
142145
release: {{ .Release.Name }}
143146
heritage: {{ .Release.Service }}
147+
{{- if .Values.st2api.annotations }}
148+
annotations: {{- toYaml .Values.st2api.annotations | nindent 4 }}
149+
{{- end }}
144150
spec:
145151
selector:
146152
matchLabels:
@@ -268,6 +274,9 @@ metadata:
268274
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
269275
release: {{ .Release.Name }}
270276
heritage: {{ .Release.Service }}
277+
{{- if .Values.st2stream.annotations }}
278+
annotations: {{- toYaml .Values.st2stream.annotations | nindent 4 }}
279+
{{- end }}
271280
spec:
272281
selector:
273282
matchLabels:
@@ -367,6 +376,9 @@ metadata:
367376
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
368377
release: {{ .Release.Name }}
369378
heritage: {{ .Release.Service }}
379+
{{- if .Values.st2web.annotations }}
380+
annotations: {{- toYaml .Values.st2web.annotations | nindent 4 }}
381+
{{- end }}
370382
spec:
371383
selector:
372384
matchLabels:
@@ -501,6 +513,9 @@ metadata:
501513
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
502514
release: {{ .Release.Name }}
503515
heritage: {{ .Release.Service }}
516+
{{- if .Values.st2rulesengine.annotations }}
517+
annotations: {{- toYaml .Values.st2rulesengine.annotations | nindent 4 }}
518+
{{- end }}
504519
spec:
505520
selector:
506521
matchLabels:
@@ -612,6 +627,9 @@ metadata:
612627
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
613628
release: {{ .Release.Name }}
614629
heritage: {{ .Release.Service }}
630+
{{- if .Values.st2timersengine.annotations }}
631+
annotations: {{- toYaml .Values.st2timersengine.annotations | nindent 4 }}
632+
{{- end }}
615633
spec:
616634
selector:
617635
matchLabels:
@@ -710,6 +728,9 @@ metadata:
710728
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
711729
release: {{ .Release.Name }}
712730
heritage: {{ .Release.Service }}
731+
{{- if .Values.st2workflowengine.annotations }}
732+
annotations: {{- toYaml .Values.st2workflowengine.annotations | nindent 4 }}
733+
{{- end }}
713734
spec:
714735
selector:
715736
matchLabels:
@@ -829,6 +850,9 @@ metadata:
829850
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
830851
release: {{ .Release.Name }}
831852
heritage: {{ .Release.Service }}
853+
{{- if .Values.st2scheduler.annotations }}
854+
annotations: {{- toYaml .Values.st2scheduler.annotations | nindent 4 }}
855+
{{- end }}
832856
spec:
833857
selector:
834858
matchLabels:
@@ -939,6 +963,9 @@ metadata:
939963
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
940964
release: {{ .Release.Name }}
941965
heritage: {{ .Release.Service }}
966+
{{- if .Values.st2notifier.annotations }}
967+
annotations: {{- toYaml .Values.st2notifier.annotations | nindent 4 }}
968+
{{- end }}
942969
spec:
943970
selector:
944971
matchLabels:
@@ -1045,6 +1072,9 @@ metadata:
10451072
chart: {{ $.Chart.Name }}-{{ $.Chart.Version }}
10461073
release: {{ $.Release.Name }}
10471074
heritage: {{ $.Release.Service }}
1075+
{{- if $sensor.annotations }}
1076+
annotations: {{- toYaml $sensor.annotations | nindent 4 }}
1077+
{{- end }}
10481078
spec:
10491079
selector:
10501080
matchLabels:
@@ -1203,6 +1233,9 @@ metadata:
12031233
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
12041234
release: {{ .Release.Name }}
12051235
heritage: {{ .Release.Service }}
1236+
{{- if .Values.st2actionrunner.annotations }}
1237+
annotations: {{- toYaml .Values.st2actionrunner.annotations | nindent 4 }}
1238+
{{- end }}
12061239
spec:
12071240
selector:
12081241
matchLabels:
@@ -1352,6 +1385,9 @@ metadata:
13521385
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
13531386
release: {{ .Release.Name }}
13541387
heritage: {{ .Release.Service }}
1388+
{{- if .Values.st2garbagecollector.annotations }}
1389+
annotations: {{- toYaml .Values.st2garbagecollector.annotations | nindent 4 }}
1390+
{{- end }}
13551391
spec:
13561392
selector:
13571393
matchLabels:
@@ -1449,6 +1485,9 @@ metadata:
14491485
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
14501486
release: {{ .Release.Name }}
14511487
heritage: {{ .Release.Service }}
1488+
{{- if .Values.st2client.annotations }}
1489+
annotations: {{- toYaml .Values.st2client.annotations | nindent 4 }}
1490+
{{- end }}
14521491
spec:
14531492
selector:
14541493
matchLabels:
@@ -1632,6 +1671,9 @@ metadata:
16321671
chart: {{ .Chart.Name }}-{{ .Chart.Version }}
16331672
release: {{ .Release.Name }}
16341673
heritage: {{ .Release.Service }}
1674+
{{- if .Values.st2chatops.annotations }}
1675+
annotations: {{- toYaml .Values.st2chatops.annotations | nindent 4 }}
1676+
{{- end }}
16351677
spec:
16361678
selector:
16371679
matchLabels:

templates/jobs.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ metadata:
1515
helm.sh/hook: post-install, post-upgrade, post-rollback
1616
helm.sh/hook-delete-policy: before-hook-creation
1717
helm.sh/hook-weight: "5"
18+
{{- if .Values.jobs.annotations }}
19+
{{- toYaml .Values.jobs.annotations | nindent 4 }}
20+
{{- end }}
1821
spec:
1922
template:
2023
metadata:
@@ -114,6 +117,9 @@ metadata:
114117
helm.sh/hook: post-install, post-upgrade, post-rollback
115118
helm.sh/hook-delete-policy: before-hook-creation
116119
helm.sh/hook-weight: "6"
120+
{{- if .Values.jobs.annotations }}
121+
{{- toYaml .Values.jobs.annotations | nindent 4 }}
122+
{{- end }}
117123
spec:
118124
template:
119125
metadata:
@@ -241,6 +247,9 @@ metadata:
241247
helm.sh/hook: post-install, post-upgrade, post-rollback
242248
helm.sh/hook-delete-policy: before-hook-creation
243249
helm.sh/hook-weight: "6"
250+
{{- if .Values.jobs.annotations }}
251+
{{- toYaml .Values.jobs.annotations | nindent 4 }}
252+
{{- end }}
244253
spec:
245254
template:
246255
metadata:
@@ -362,6 +371,9 @@ metadata:
362371
helm.sh/hook: post-install, post-upgrade, post-rollback
363372
helm.sh/hook-delete-policy: before-hook-creation
364373
helm.sh/hook-weight: "7"
374+
{{- if .Values.jobs.annotations }}
375+
{{- toYaml .Values.jobs.annotations | nindent 4 }}
376+
{{- end }}
365377
spec:
366378
template:
367379
metadata:

0 commit comments

Comments
 (0)