From 5de1338ff14d9efd1df1589ebeb2d4ab0f268992 Mon Sep 17 00:00:00 2001 From: Fabio Rauber Date: Fri, 1 Jul 2022 11:31:50 -0300 Subject: [PATCH] Implement podAntiAffinity for postfix --- charts/postfix/v0.1.0/templates/deployment.yaml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/charts/postfix/v0.1.0/templates/deployment.yaml b/charts/postfix/v0.1.0/templates/deployment.yaml index 03efe7a..71a8c30 100644 --- a/charts/postfix/v0.1.0/templates/deployment.yaml +++ b/charts/postfix/v0.1.0/templates/deployment.yaml @@ -63,10 +63,20 @@ spec: nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.affinity }} affinity: - {{- toYaml . | nindent 8 }} - {{- end }} + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app.kubernetes.io/name + operator: In + values: + - {{ include "postfix.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + topologyKey: "kubernetes.io/hostname" {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }}