From 46a7bb68f6f3116acd57e770cde0af5dd681b188 Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Tue, 17 Aug 2021 14:44:48 -0300 Subject: [PATCH] Configured pod affinity for repozo cronjob --- .../v0.5.0/templates/repozo-cronjob.yaml | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/charts/portalmodelo/v0.5.0/templates/repozo-cronjob.yaml b/charts/portalmodelo/v0.5.0/templates/repozo-cronjob.yaml index 57efe96..204200b 100644 --- a/charts/portalmodelo/v0.5.0/templates/repozo-cronjob.yaml +++ b/charts/portalmodelo/v0.5.0/templates/repozo-cronjob.yaml @@ -33,7 +33,7 @@ spec: - "/bin/bash" - "-c" args: - - "/plone/instance/bin/backup" + - "/plone/Python-2.7/bin/python /plone/instance/bin/backup" env: - name: TZ value: {{ .Values.portal.timeZone }} @@ -62,10 +62,24 @@ spec: nodeSelector: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.affinity }} affinity: - {{- toYaml . | nindent 12 }} - {{- end }} + podAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "portalmodelo.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + - key: app.kubernetes.io/component + operator: In + values: + - zeoserver + topologyKey: kubernetes.io/hostname {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 12 }}