From aa60b68992a8ba2344eb7779834236f1a754b63c Mon Sep 17 00:00:00 2001 From: galal-hussein Date: Mon, 7 May 2018 21:11:16 +0200 Subject: [PATCH] Add pod antiaffinity to kubedns template --- templates/kubedns.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/templates/kubedns.go b/templates/kubedns.go index efe9a8b9..fb7af9db 100644 --- a/templates/kubedns.go +++ b/templates/kubedns.go @@ -113,6 +113,17 @@ spec: annotations: scheduler.alpha.kubernetes.io/critical-pod: '' spec: + affinity: + podAntiAffinity: + preferredDuringSchedulingIgnoredDuringExecution: + - weight: 100 + podAffinityTerm: + labelSelector: + matchExpressions: + - key: k8s-app + operator: In + values: ["kube-dns"] + topologyKey: kubernetes.io/hostname tolerations: - key: "CriticalAddonsOnly" operator: "Exists"