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 }} 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: