From 1415fcc6dc31f85f9454463de39aa23cdb70d654 Mon Sep 17 00:00:00 2001 From: Andrew Keesler Date: Fri, 21 Aug 2020 11:14:45 -0400 Subject: [PATCH] Add pod anti-affinity to make our HA deployment more HA Signed-off-by: Andrew Keesler --- deploy/deployment.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/deploy/deployment.yaml b/deploy/deployment.yaml index 9271bc8e..6900e08c 100644 --- a/deploy/deployment.yaml +++ b/deploy/deployment.yaml @@ -130,6 +130,17 @@ spec: #! "system-cluster-critical" cannot be used outside the kube-system namespace until Kubernetes >= 1.17, #! so we skip setting this for now (see https://github.com/kubernetes/kubernetes/issues/60596). #!priorityClassName: system-cluster-critical + #! This will help make sure our multiple pods run on different nodes, making + #! our deployment "more" "HA". + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 50 + podAffinityTerm: + labelSelector: + matchLabels: + app: #@ data.values.app_name + topologyKey: kubernetes.io/hostname --- apiVersion: v1 kind: Service