From aeefd9d1211410b3bf608080eb4a5d7ecbcc9b1d Mon Sep 17 00:00:00 2001 From: "anthony.bellino" Date: Thu, 23 May 2019 21:37:17 +0000 Subject: [PATCH] Add pod anti-affinity to Deckhand MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PS adds pod anti-affinity to deckhand 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: Icab673726d0473662ccf45c4c576fe20912a1260 --- charts/deckhand/templates/deployment.yaml | 2 ++ charts/deckhand/values.yaml | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/charts/deckhand/templates/deployment.yaml b/charts/deckhand/templates/deployment.yaml index 24f9137c..3773b9f7 100644 --- a/charts/deckhand/templates/deployment.yaml +++ b/charts/deckhand/templates/deployment.yaml @@ -40,6 +40,8 @@ spec: spec: serviceAccountName: {{ $serviceAccountName }} {{ dict "envAll" $envAll "application" "deckhand" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} + affinity: +{{ tuple $envAll "deckhand" "api" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} nodeSelector: {{ .Values.labels.api.node_selector_key }}: {{ .Values.labels.api.node_selector_value }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.deckhand.timeout | default "30" }} diff --git a/charts/deckhand/values.yaml b/charts/deckhand/values.yaml index b92ea35d..58e5faa2 100644 --- a/charts/deckhand/values.yaml +++ b/charts/deckhand/values.yaml @@ -354,6 +354,12 @@ pod: termination_grace_period: deckhand: timeout: 30 + affinity: + anti: + type: + default: preferredDuringSchedulingIgnoredDuringExecution + topologyKey: + default: kubernetes.io/hostname replicas: deckhand: 1 resources: