From 7d2f30818cf7db016bfa61b34ef51901fc30095f Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Wed, 22 Sep 2021 10:50:37 -0300 Subject: [PATCH] Use podaffinity to ease sapl upgrades with rwo vol --- charts/sapl/v0.2.0/templates/deployment.yaml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/charts/sapl/v0.2.0/templates/deployment.yaml b/charts/sapl/v0.2.0/templates/deployment.yaml index 18d728d..822f29a 100644 --- a/charts/sapl/v0.2.0/templates/deployment.yaml +++ b/charts/sapl/v0.2.0/templates/deployment.yaml @@ -108,8 +108,23 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} affinity: + podAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "sapl.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + topologyKey: kubernetes.io/hostname + {{- with .Values.affinity }} {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }}