From a30857af28ce68bdce6abb4f022cc7843105b6c6 Mon Sep 17 00:00:00 2001 From: Oliver Date: Wed, 28 Nov 2018 17:22:37 -0600 Subject: [PATCH] Added options to allow custom variables in the fluentd conf files (#9607) * Added options to allow custom variables in the fluentd conf files Signed-off-by: Oliver Isaac * Chart version bump Signed-off-by: Oliver Isaac * Switched to using .Values.env instead of .Values.elasticsearch.env as it is more accurate for what env does Signed-off-by: Oliver Isaac --- stable/fluentd-elasticsearch/Chart.yaml | 2 +- stable/fluentd-elasticsearch/README.md | 1 + stable/fluentd-elasticsearch/templates/daemonset.yaml | 6 ++++++ stable/fluentd-elasticsearch/values.yaml | 6 ++++++ 4 files changed, 14 insertions(+), 1 deletion(-) diff --git a/stable/fluentd-elasticsearch/Chart.yaml b/stable/fluentd-elasticsearch/Chart.yaml index 02b7ceff6b..3a266056db 100644 --- a/stable/fluentd-elasticsearch/Chart.yaml +++ b/stable/fluentd-elasticsearch/Chart.yaml @@ -1,5 +1,5 @@ name: fluentd-elasticsearch -version: 1.3.0 +version: 1.4.0 appVersion: 2.3.1 home: https://www.fluentd.org/ description: A Fluentd Helm chart for Kubernetes with Elasticsearch output diff --git a/stable/fluentd-elasticsearch/README.md b/stable/fluentd-elasticsearch/README.md index 304f6da64e..f20688321d 100644 --- a/stable/fluentd-elasticsearch/README.md +++ b/stable/fluentd-elasticsearch/README.md @@ -52,6 +52,7 @@ The following table lists the configurable parameters of the Fluentd elasticsear | `elasticsearch.logstash_prefix` | Elasticsearch Logstash prefix | `logstash` | | `elasticsearch.buffer_chunk_limit` | Elasticsearch buffer chunk limit | `2M` | | `elasticsearch.buffer_queue_limit` | Elasticsearch buffer queue limit | `8` | +| `env` | List of environment variables that are added to the fluentd pods | `{}` | | `extraVolumeMounts` | Mount an extra volume, required to mount ssl certificates when elasticsearch has tls enabled | | | `extraVolume` | Extra volume | | | `image.repository` | Image | `gcr.io/google-containers/fluentd-elasticsearch` | diff --git a/stable/fluentd-elasticsearch/templates/daemonset.yaml b/stable/fluentd-elasticsearch/templates/daemonset.yaml index 32b52c6758..13146e6099 100644 --- a/stable/fluentd-elasticsearch/templates/daemonset.yaml +++ b/stable/fluentd-elasticsearch/templates/daemonset.yaml @@ -53,6 +53,12 @@ spec: value: {{ .Values.elasticsearch.buffer_chunk_limit | quote }} - name: OUTPUT_BUFFER_QUEUE_LIMIT value: {{ .Values.elasticsearch.buffer_queue_limit | quote }} + {{- if .Values.env }} + {{- range $key, $value := .Values.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + {{- end }} - name: K8S_NODE_NAME valueFrom: fieldRef: diff --git a/stable/fluentd-elasticsearch/values.yaml b/stable/fluentd-elasticsearch/values.yaml index 2742c12fa4..440c5a3d33 100644 --- a/stable/fluentd-elasticsearch/values.yaml +++ b/stable/fluentd-elasticsearch/values.yaml @@ -24,6 +24,12 @@ elasticsearch: buffer_queue_limit: 8 logstash_prefix: 'logstash' +# If you want to add custom environment variables, use the env dict +# You can then reference these in your config file e.g.: +# user "#{ENV['OUTPUT_USER']}" +env: + # OUTPUT_USER: my_user + rbac: create: true