From eba953cc8e15b9dc59dcb242e3555785c069580e Mon Sep 17 00:00:00 2001 From: Kevin Lefevre Date: Thu, 31 Jan 2019 21:04:07 +0100 Subject: [PATCH] [incubator/fluentd-cloudwatch] add affinity/nodeselector (#10850) Signed-off-by: ArchiFleKs --- incubator/fluentd-cloudwatch/Chart.yaml | 2 +- incubator/fluentd-cloudwatch/README.md | 2 ++ .../fluentd-cloudwatch/templates/daemonset.yaml | 10 +++++++++- incubator/fluentd-cloudwatch/values.yaml | 17 +++++++++++++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/incubator/fluentd-cloudwatch/Chart.yaml b/incubator/fluentd-cloudwatch/Chart.yaml index 36d329d3d9..33f0e5d56a 100644 --- a/incubator/fluentd-cloudwatch/Chart.yaml +++ b/incubator/fluentd-cloudwatch/Chart.yaml @@ -1,5 +1,5 @@ name: fluentd-cloudwatch -version: 0.6.4 +version: 0.7.0 appVersion: v0.12.43-cloudwatch description: A Fluentd CloudWatch Helm chart for Kubernetes. home: https://www.fluentd.org/ diff --git a/incubator/fluentd-cloudwatch/README.md b/incubator/fluentd-cloudwatch/README.md index fec16b7172..10a9bbb3ca 100644 --- a/incubator/fluentd-cloudwatch/README.md +++ b/incubator/fluentd-cloudwatch/README.md @@ -68,6 +68,8 @@ The following table lists the configurable parameters of the Fluentd Cloudwatch | `tolerations` | Add tolerations | `[]` | | `extraVars` | Add pod environment variables (must be specified as a single line object) | `[]` | | `updateStrategy` | Define daemonset update strategy | `OnDelete` | +| `nodeSelector` | Node labels for pod assignment | `{}` | +| `affinity` | Node affinity for pod assignment | `{}` | Starting with fluentd-kubernetes-daemonset v0.12.43-cloudwatch, the container runs as user fluentd. To be able to write pos files to the host system, you'll need to run fluentd as root. Add the following extraVars value to run as root. diff --git a/incubator/fluentd-cloudwatch/templates/daemonset.yaml b/incubator/fluentd-cloudwatch/templates/daemonset.yaml index b72a6e1f47..785b4b1d38 100644 --- a/incubator/fluentd-cloudwatch/templates/daemonset.yaml +++ b/incubator/fluentd-cloudwatch/templates/daemonset.yaml @@ -86,5 +86,13 @@ spec: tolerations: {{ toYaml .Values.tolerations | indent 6 }} {{- end }} + {{- if .Values.affinity }} + affinity: +{{ toYaml .Values.affinity | indent 8 }} + {{- end }} + {{- if .Values.nodeSelector }} + nodeSelector: +{{ toYaml .Values.nodeSelector | indent 8 }} + {{- end }} updateStrategy: -{{ toYaml .Values.updateStrategy | indent 4 }} \ No newline at end of file +{{ toYaml .Values.updateStrategy | indent 4 }} diff --git a/incubator/fluentd-cloudwatch/values.yaml b/incubator/fluentd-cloudwatch/values.yaml index ebc8dc25be..2f0e79d384 100644 --- a/incubator/fluentd-cloudwatch/values.yaml +++ b/incubator/fluentd-cloudwatch/values.yaml @@ -19,6 +19,23 @@ resources: # hostNetwork: false +## Node labels for pod assignment +## Ref: https://kubernetes.io/docs/user-guide/node-selection/ +## +nodeSelector: {} + # kubernetes.io/role: node +# Ref: https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.11/#affinity-v1-core +# Expects input structure as per specification for example: +# affinity: +# nodeAffinity: +# requiredDuringSchedulingIgnoredDuringExecution: +# nodeSelectorTerms: +# - matchExpressions: +# - key: foo.bar.com/role +# operator: In +# values: +# - master +affinity: {} ## Add tolerations if specified tolerations: [] # - key: node-role.kubernetes.io/master