From 7959ff54334c004fb3879bb4e280f171b5f36ac8 Mon Sep 17 00:00:00 2001 From: Fabio Date: Tue, 29 Nov 2022 11:36:17 -0300 Subject: [PATCH] Snappymail containers should not run on same host --- .../v0.1.0/templates/deployment.yaml | 18 +++++++++++++++--- charts/snappymail/v0.1.0/values.yaml | 2 -- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/charts/snappymail/v0.1.0/templates/deployment.yaml b/charts/snappymail/v0.1.0/templates/deployment.yaml index 114862d..c439d82 100644 --- a/charts/snappymail/v0.1.0/templates/deployment.yaml +++ b/charts/snappymail/v0.1.0/templates/deployment.yaml @@ -53,10 +53,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 "snappymail.name" . }} + - key: app.kubernetes.io/instance + operator: In + values: + - {{ .Release.Name }} + topologyKey: "kubernetes.io/hostname" {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} diff --git a/charts/snappymail/v0.1.0/values.yaml b/charts/snappymail/v0.1.0/values.yaml index bc30315..235e488 100644 --- a/charts/snappymail/v0.1.0/values.yaml +++ b/charts/snappymail/v0.1.0/values.yaml @@ -64,8 +64,6 @@ nodeSelector: {} tolerations: [] -affinity: {} - persistence: accessMode: ReadWriteMany size: 8Gi