From 90d9601f624b421b103696b466f7ab6cb408d586 Mon Sep 17 00:00:00 2001 From: "anthony.bellino" Date: Wed, 29 May 2019 22:08:22 +0000 Subject: [PATCH] Add pod anti-affinity to apiserver-webhook MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PS adds pod anti-affinity to apiserver-webhook pods, so that the scheduler can constrain pods against labels on other pods running on the node. The default soft rule is in place so that if the scheduler can’t satisfy the requirement, the pod will still be scheduled. Change-Id: I8c118410b822d4fed44693b8a0308c8eff103978 --- charts/apiserver-webhook/templates/deployment.yaml | 2 ++ charts/apiserver-webhook/values.yaml | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/charts/apiserver-webhook/templates/deployment.yaml b/charts/apiserver-webhook/templates/deployment.yaml index a9ac0ba8..286f1ff5 100644 --- a/charts/apiserver-webhook/templates/deployment.yaml +++ b/charts/apiserver-webhook/templates/deployment.yaml @@ -117,6 +117,8 @@ spec: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} spec: + affinity: +{{ tuple $envAll "kubernetes-keystone-webhook" "api" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} dnsPolicy: ClusterFirst containers: - name: apiserver diff --git a/charts/apiserver-webhook/values.yaml b/charts/apiserver-webhook/values.yaml index 52a93732..f93cc48e 100644 --- a/charts/apiserver-webhook/values.yaml +++ b/charts/apiserver-webhook/values.yaml @@ -187,6 +187,12 @@ pod: kubernetes_apiserver: init_container: null kubernetes_apiserver: + affinity: + anti: + type: + default: preferredDuringSchedulingIgnoredDuringExecution + topologyKey: + default: kubernetes.io/hostname replicas: apiserver: 1 api: 1