Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow adding nodeSelector, affinity, tolerations to batch Jobs #193

Merged
merged 2 commits into from
Jul 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
* Add image.tag overrides for all deployments. (#200) (by @cognifloyd)
* 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)
* Add optional hubot-scripts volume to st2chatops pod. To add this, define `st2chatops.hubotScriptsVolume`. (#207) (by @cognifloyd)
* Add advanced pod placment (nodeSelector, affinity, tolerations) to specs for batch Jobs pods. (#193) (by @cognifloyd)

## v0.60.0
* Switch st2 version to `v3.5dev` as a new latest development version (#187)
Expand Down
36 changes: 36 additions & 0 deletions templates/jobs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ spec:
configMap:
name: {{ .Release.Name }}-st2-rbac-mappings
restartPolicy: OnFailure
{{- with .Values.jobs.nodeSelector }}
nodeSelector: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.jobs.affinity }}
affinity: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.jobs.tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}

{{- end }}
---
Expand Down Expand Up @@ -188,6 +197,15 @@ spec:
secret:
secretName: {{ .Release.Name }}-st2-apikeys
restartPolicy: OnFailure
{{- with .Values.jobs.nodeSelector }}
nodeSelector: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.jobs.affinity }}
affinity: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.jobs.tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}

---
apiVersion: batch/v1
Expand Down Expand Up @@ -298,6 +316,15 @@ spec:
secret:
secretName: {{ .Release.Name }}-st2-kv
restartPolicy: OnFailure
{{- with .Values.jobs.nodeSelector }}
nodeSelector: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.jobs.affinity }}
affinity: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.jobs.tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}

---
apiVersion: batch/v1
Expand Down Expand Up @@ -383,3 +410,12 @@ spec:
name: {{ .Release.Name }}-st2-pack-configs
{{- include "packs-volumes" $ | nindent 8 }}
restartPolicy: OnFailure
{{- with .Values.jobs.nodeSelector }}
nodeSelector: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.jobs.affinity }}
affinity: {{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.jobs.tolerations }}
tolerations: {{- toYaml . | nindent 8 }}
{{- end }}
4 changes: 4 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,10 @@ jobs:
image: {}
## Note that Helm templating is supported in this block!
#tag: "{{ .Values.image.tag }}"
# Additional advanced settings to control pod/deployment placement
nodeSelector: {}
tolerations: []
affinity: {}

##
## MongoDB HA configuration (3rd party chart dependency)
Expand Down