From b4b1dd9528ab32773d3e5be4736aacf806a766dc Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Mon, 3 Jun 2019 11:33:56 -0500 Subject: [PATCH] Add missing affinity keys to chart pod specs This adds the affinity key to the pod spec for the grafana, nagios, kube-state-metrics, and openstack-exporter charts as it was previously missed Change-Id: Ifefa88d7f33607b4d595effa5fbf72f3387e5081 Signed-off-by: Steve Wilkerson --- grafana/templates/deployment.yaml | 2 ++ nagios/templates/deployment.yaml | 2 ++ nagios/values.yaml | 8 ++++++++ prometheus-kube-state-metrics/templates/deployment.yaml | 2 ++ prometheus-openstack-exporter/templates/deployment.yaml | 2 ++ 5 files changed, 16 insertions(+) diff --git a/grafana/templates/deployment.yaml b/grafana/templates/deployment.yaml index 1040dc99a..3b07b6461 100644 --- a/grafana/templates/deployment.yaml +++ b/grafana/templates/deployment.yaml @@ -47,6 +47,8 @@ spec: spec: {{ dict "envAll" $envAll "application" "dashboard" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} serviceAccountName: {{ $serviceAccountName }} + affinity: +{{ tuple $envAll "grafana" "dashboard" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} nodeSelector: {{ .Values.labels.grafana.node_selector_key }}: {{ .Values.labels.grafana.node_selector_value | quote }} initContainers: diff --git a/nagios/templates/deployment.yaml b/nagios/templates/deployment.yaml index f910f94b6..1bb2b24c1 100644 --- a/nagios/templates/deployment.yaml +++ b/nagios/templates/deployment.yaml @@ -84,6 +84,8 @@ spec: spec: {{ dict "envAll" $envAll "application" "monitoring" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} serviceAccountName: {{ $serviceAccountName }} + affinity: +{{ tuple $envAll "nagios" "monitoring" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} nodeSelector: {{ .Values.labels.nagios.node_selector_key }}: {{ .Values.labels.nagios.node_selector_value | quote }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.nagios.timeout | default "30" }} diff --git a/nagios/values.yaml b/nagios/values.yaml index cd15d2a4c..eeaf32e71 100644 --- a/nagios/values.yaml +++ b/nagios/values.yaml @@ -214,6 +214,14 @@ pod: readOnlyRootFilesystem: false helm_tests: readOnlyRootFilesystem: false + affinity: + anti: + type: + default: preferredDuringSchedulingIgnoredDuringExecution + topologyKey: + default: kubernetes.io/hostname + weight: + default: 10 lifecycle: upgrades: revision_history: 3 diff --git a/prometheus-kube-state-metrics/templates/deployment.yaml b/prometheus-kube-state-metrics/templates/deployment.yaml index 60d03db75..febe86f38 100644 --- a/prometheus-kube-state-metrics/templates/deployment.yaml +++ b/prometheus-kube-state-metrics/templates/deployment.yaml @@ -113,6 +113,8 @@ spec: spec: {{ dict "envAll" $envAll "application" "exporter" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} serviceAccountName: {{ $serviceAccountName }} + affinity: +{{ tuple $envAll "kube-state-metrics" "exporter" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} nodeSelector: {{ .Values.labels.kube_state_metrics.node_selector_key }}: {{ .Values.labels.kube_state_metrics.node_selector_value | quote }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.kube_state_metrics.timeout | default "30" }} diff --git a/prometheus-openstack-exporter/templates/deployment.yaml b/prometheus-openstack-exporter/templates/deployment.yaml index c0b0dabb8..15b595f0a 100644 --- a/prometheus-openstack-exporter/templates/deployment.yaml +++ b/prometheus-openstack-exporter/templates/deployment.yaml @@ -45,6 +45,8 @@ spec: spec: {{ dict "envAll" $envAll "application" "exporter" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} serviceAccountName: {{ $serviceAccountName }} + affinity: +{{ tuple $envAll "prometheus-openstack-exporter" "exporter" | include "helm-toolkit.snippets.kubernetes_pod_anti_affinity" | indent 8 }} nodeSelector: {{ .Values.labels.openstack_exporter.node_selector_key }}: {{ .Values.labels.openstack_exporter.node_selector_value | quote }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.prometheus_openstack_exporter.timeout | default "30" }}