From 6b6f277e7d72dfdba954bca52db6e2d430254157 Mon Sep 17 00:00:00 2001 From: Seungkyu Ahn Date: Thu, 5 Jul 2018 03:43:10 +0000 Subject: [PATCH] Running agents on all nodes. Using a node selector can not run the fluent-bit or node-exporter on the master node. So, This PS changes the scheduling to use either taint/toleration or the node selector. Change-Id: I0ca80a6e645b7047469288697387f0f5bf111345 --- fluent-logging/templates/daemonset-fluent-bit.yaml | 8 ++++++++ fluent-logging/values.yaml | 2 ++ prometheus-node-exporter/templates/daemonset.yaml | 8 ++++++++ prometheus-node-exporter/values.yaml | 2 ++ 4 files changed, 20 insertions(+) diff --git a/fluent-logging/templates/daemonset-fluent-bit.yaml b/fluent-logging/templates/daemonset-fluent-bit.yaml index 30a6b0360..01349b0ba 100644 --- a/fluent-logging/templates/daemonset-fluent-bit.yaml +++ b/fluent-logging/templates/daemonset-fluent-bit.yaml @@ -91,8 +91,16 @@ spec: configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} spec: serviceAccountName: {{ $serviceAccountName }} +{{ if .Values.labels.fluentbit.tolerations }} + tolerations: + - key: node-role.kubernetes.io/master + operator: Exists + - key: node-role.kubernetes.io/node + operator: Exists +{{ else }} nodeSelector: {{ .Values.labels.fluentbit.node_selector_key }}: {{ .Values.labels.fluentbit.node_selector_value | quote }} +{{ end }} hostNetwork: true hostPID: true dnsPolicy: ClusterFirstWithHostNet diff --git a/fluent-logging/values.yaml b/fluent-logging/values.yaml index 784822700..4b6d26c52 100644 --- a/fluent-logging/values.yaml +++ b/fluent-logging/values.yaml @@ -23,8 +23,10 @@ labels: node_selector_key: openstack-control-plane node_selector_value: enabled fluentbit: + #(NOTE:seungkyua): when tolerations is true, nodeSelector will be disabled. node_selector_key: openstack-control-plane node_selector_value: enabled + tolerations: false prometheus_fluentd_exporter: node_selector_key: openstack-control-plane node_selector_value: enabled diff --git a/prometheus-node-exporter/templates/daemonset.yaml b/prometheus-node-exporter/templates/daemonset.yaml index 285654866..de45f94aa 100644 --- a/prometheus-node-exporter/templates/daemonset.yaml +++ b/prometheus-node-exporter/templates/daemonset.yaml @@ -52,8 +52,16 @@ spec: namespace: {{ .Values.endpoints.node_metrics.namespace }} spec: serviceAccountName: {{ $serviceAccountName }} +{{ if .Values.labels.node_exporter.tolerations }} + tolerations: + - key: node-role.kubernetes.io/master + operator: Exists + - key: node-role.kubernetes.io/node + operator: Exists +{{ else }} nodeSelector: {{ .Values.labels.node_exporter.node_selector_key }}: {{ .Values.labels.node_exporter.node_selector_value | quote }} +{{ end }} hostNetwork: true hostPID: true initContainers: diff --git a/prometheus-node-exporter/values.yaml b/prometheus-node-exporter/values.yaml index fb33a49f9..f8438f11b 100644 --- a/prometheus-node-exporter/values.yaml +++ b/prometheus-node-exporter/values.yaml @@ -29,9 +29,11 @@ images: - image_repo_sync labels: + #(NOTE:seungkyua): when tolerations is true, nodeSelector will be disabled. node_exporter: node_selector_key: openstack-control-plane node_selector_value: enabled + tolerations: false job: node_selector_key: openstack-control-plane node_selector_value: enabled