From 4d3ba00e5b7a3bebc8f389614313b3bc260a677f Mon Sep 17 00:00:00 2001 From: Vasily Oleynikov Date: Wed, 26 Jun 2024 14:59:00 +0300 Subject: [PATCH] [controller] add pod antiaffinity rules (#45) Signed-off-by: v.oleynikov --- .../sds-local-volume-controller/deployment.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/templates/sds-local-volume-controller/deployment.yaml b/templates/sds-local-volume-controller/deployment.yaml index 08cc6cc4..1b21ca66 100644 --- a/templates/sds-local-volume-controller/deployment.yaml +++ b/templates/sds-local-volume-controller/deployment.yaml @@ -61,6 +61,20 @@ spec: {{- include "helm_lib_node_selector" (tuple . "system") | nindent 6 }} {{- include "helm_lib_tolerations" (tuple . "system") | nindent 6 }} {{- include "helm_lib_module_pod_security_context_run_as_user_nobody" . | nindent 6 }} +{{- if (include "helm_lib_ha_enabled" .) }} + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - podAffinityTerm: + labelSelector: + matchExpressions: + - key: app + operator: In + values: + - sds-local-volume-controller + topologyKey: kubernetes.io/hostname + weight: 100 +{{- end }} imagePullSecrets: - name: {{ .Chart.Name }}-module-registry serviceAccountName: sds-local-volume-controller