From b1012fe986f4c02f7f0dc73f32eba86618ea34ee Mon Sep 17 00:00:00 2001 From: Fabio Date: Thu, 8 Sep 2022 10:49:41 -0300 Subject: [PATCH] Add podAntiAffinity for mailproxy mailauth --- .../v0.1.0/templates/mailauth-deployment.yaml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/charts/mailproxy/v0.1.0/templates/mailauth-deployment.yaml b/charts/mailproxy/v0.1.0/templates/mailauth-deployment.yaml index 40f8448..08188ff 100644 --- a/charts/mailproxy/v0.1.0/templates/mailauth-deployment.yaml +++ b/charts/mailproxy/v0.1.0/templates/mailauth-deployment.yaml @@ -57,10 +57,22 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} affinity: - {{- toYaml . | nindent 8 }} - {{- end }} + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "mailproxy.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + topologyKey: "kubernetes.io/hostname" {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }}