From 89e676e252f650f8b09f21404b6647d81fb38603 Mon Sep 17 00:00:00 2001 From: Anish Asthana Date: Fri, 28 Oct 2022 15:12:57 -0400 Subject: [PATCH] feat: Set pod anti-affinity for modelmesh manager The pod anti-affinity will tell the Kubernetes schedule to schedule pods on different nodes if possible. This will allow users to enable HA by setting the number of replicas to a number greater than 1 Signed-off-by: Anish Asthana --- config/manager/manager.yaml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/config/manager/manager.yaml b/config/manager/manager.yaml index 3b4f80d4..67328238 100644 --- a/config/manager/manager.yaml +++ b/config/manager/manager.yaml @@ -21,7 +21,7 @@ spec: selector: matchLabels: control-plane: modelmesh-controller - replicas: 1 + replicas: 1 # This can be increased safely to enable HA. A good value to set is 3. template: metadata: labels: @@ -36,6 +36,17 @@ spec: operator: In values: - amd64 + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: control-plane + operator: In + values: + - modelmesh-controller + topologyKey: topology.kubernetes.io/zone containers: - command: - /manager