Skip to content

Commit 4455269

Browse files
committed
add advanced pod/deployment placement settings for Jobs
1 parent 7d55c49 commit 4455269

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

templates/jobs.yaml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,15 @@ spec:
7777
configMap:
7878
name: {{ .Release.Name }}-st2-rbac-mappings
7979
restartPolicy: OnFailure
80+
{{- with .Values.jobs.nodeSelector }}
81+
nodeSelector: {{- toYaml . | nindent 8 }}
82+
{{- end }}
83+
{{- with .Values.jobs.affinity }}
84+
affinity: {{- toYaml . | nindent 8 }}
85+
{{- end }}
86+
{{- with .Values.jobs.tolerations }}
87+
tolerations: {{- toYaml . | nindent 8 }}
88+
{{- end }}
8089

8190
{{- end }}
8291
---
@@ -188,6 +197,15 @@ spec:
188197
secret:
189198
secretName: {{ .Release.Name }}-st2-apikeys
190199
restartPolicy: OnFailure
200+
{{- with .Values.jobs.nodeSelector }}
201+
nodeSelector: {{- toYaml . | nindent 8 }}
202+
{{- end }}
203+
{{- with .Values.jobs.affinity }}
204+
affinity: {{- toYaml . | nindent 8 }}
205+
{{- end }}
206+
{{- with .Values.jobs.tolerations }}
207+
tolerations: {{- toYaml . | nindent 8 }}
208+
{{- end }}
191209

192210
---
193211
apiVersion: batch/v1
@@ -298,6 +316,15 @@ spec:
298316
secret:
299317
secretName: {{ .Release.Name }}-st2-kv
300318
restartPolicy: OnFailure
319+
{{- with .Values.jobs.nodeSelector }}
320+
nodeSelector: {{- toYaml . | nindent 8 }}
321+
{{- end }}
322+
{{- with .Values.jobs.affinity }}
323+
affinity: {{- toYaml . | nindent 8 }}
324+
{{- end }}
325+
{{- with .Values.jobs.tolerations }}
326+
tolerations: {{- toYaml . | nindent 8 }}
327+
{{- end }}
301328

302329
---
303330
apiVersion: batch/v1
@@ -383,3 +410,12 @@ spec:
383410
name: {{ .Release.Name }}-st2-pack-configs
384411
{{- include "packs-volumes" $ | nindent 8 }}
385412
restartPolicy: OnFailure
413+
{{- with .Values.jobs.nodeSelector }}
414+
nodeSelector: {{- toYaml . | nindent 8 }}
415+
{{- end }}
416+
{{- with .Values.jobs.affinity }}
417+
affinity: {{- toYaml . | nindent 8 }}
418+
{{- end }}
419+
{{- with .Values.jobs.tolerations }}
420+
tolerations: {{- toYaml . | nindent 8 }}
421+
{{- end }}

values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -531,6 +531,10 @@ jobs:
531531
image: {}
532532
## Note that Helm templating is supported in this block!
533533
#tag: "{{ .Values.image.tag }}"
534+
# Additional advanced settings to control pod/deployment placement
535+
nodeSelector: {}
536+
tolerations: []
537+
affinity: {}
534538

535539
##
536540
## MongoDB HA configuration (3rd party chart dependency)

0 commit comments

Comments
 (0)