From 09c0d3a2b68096680501962824fec90051efff3f Mon Sep 17 00:00:00 2001 From: Daniel Polito Date: Mon, 7 Feb 2022 10:38:25 -0300 Subject: [PATCH] Improving Affinity Config for Jobs --- charts/generic/templates/cronjobs.yaml | 6 +++--- charts/generic/templates/jobs.yaml | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/charts/generic/templates/cronjobs.yaml b/charts/generic/templates/cronjobs.yaml index a2b69d5..938a3e7 100644 --- a/charts/generic/templates/cronjobs.yaml +++ b/charts/generic/templates/cronjobs.yaml @@ -114,13 +114,13 @@ spec: {{- end }} {{- end }} {{- end }} - {{- with $.Values.nodeSelector }} + {{- with $cronjob.nodeSelector | default $.Values.nodeSelector }} nodeSelector: {{ toYaml . | nindent 12 }} {{- end }} - {{- with $.Values.affinity }} + {{- with $cronjob.affinity | default $.Values.affinity }} affinity: {{ toYaml . | nindent 12 }} {{- end }} - {{- with $.Values.tolerations }} + {{- with $cronjob.tolerations | default $.Values.tolerations }} tolerations: {{ toYaml . | nindent 12 }} {{- end }} --- diff --git a/charts/generic/templates/jobs.yaml b/charts/generic/templates/jobs.yaml index 299308a..af5d6d6 100644 --- a/charts/generic/templates/jobs.yaml +++ b/charts/generic/templates/jobs.yaml @@ -123,14 +123,14 @@ spec: {{- end }} {{- end }} {{- end }} - {{- with $.Values.nodeSelector }} - nodeSelector: {{ toYaml . | nindent 8 }} + {{- with $job.nodeSelector | default $.Values.nodeSelector }} + nodeSelector: {{ toYaml . | nindent 12 }} {{- end }} - {{- with $.Values.affinity }} - affinity: {{ toYaml . | nindent 8 }} + {{- with $job.affinity | default $.Values.affinity }} + affinity: {{ toYaml . | nindent 12 }} {{- end }} - {{- with $.Values.tolerations }} - tolerations: {{ toYaml . | nindent 8 }} + {{- with $job.tolerations | default $.Values.tolerations }} + tolerations: {{ toYaml . | nindent 12 }} {{- end }} --- {{- end }}