From 5616ba88eb35ea2d6ce664e73ee56507c0a64b30 Mon Sep 17 00:00:00 2001 From: Ben Banfield-Zanin Date: Thu, 29 Jun 2023 14:28:05 +0100 Subject: [PATCH 1/2] Fix HAProxy antiAffinity topologyKey to be host rather than zone --- templates/haproxy-statefulset.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/haproxy-statefulset.yaml b/templates/haproxy-statefulset.yaml index f0dff28..a4e8649 100644 --- a/templates/haproxy-statefulset.yaml +++ b/templates/haproxy-statefulset.yaml @@ -37,7 +37,7 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: - labelSelector: matchLabels: {{ include "jitsi.haproxy.selectorLabels" $ | nindent 16 }} - topologyKey: topology.kubernetes.io/zone + topologyKey: kubernetes.io/hostname {{- if $.Values.haproxy.imagePullSecrets }} imagePullSecrets: {{- range $secretName := $.Values.haproxy.imagePullSecrets }} From 98fb82b149f2d2c1dc5c7317ff53960bf0bb072d Mon Sep 17 00:00:00 2001 From: Ben Banfield-Zanin Date: Thu, 29 Jun 2023 14:32:20 +0100 Subject: [PATCH 2/2] Web setup anti-affinity if we have replicas --- templates/web-deployment.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/templates/web-deployment.yaml b/templates/web-deployment.yaml index 56cfec9..790626a 100644 --- a/templates/web-deployment.yaml +++ b/templates/web-deployment.yaml @@ -43,6 +43,14 @@ spec: {{- range $secretName := $.Values.web.imagePullSecrets }} - name: {{ $secretName }} {{- end }} + {{- end }} + {{- if gt ($.Values.web.replicas | int) 1 }} + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchLabels: {{ include "jitsi.webShard.selectorLabels" (merge (dict "RelativeScope" .) $) | nindent 16 }} + topologyKey: kubernetes.io/hostname {{- end }} containers: - env: