From 20398053140101543bb2d497429c5caec72ec495 Mon Sep 17 00:00:00 2001 From: Steven Fitzpatrick Date: Mon, 11 May 2020 10:13:44 -0500 Subject: [PATCH] Fluentd: Render Config as Template This change updates the fluentd configmap-etc to render .Values.conf.fluentd.template as a template, allowing for greater flexibility in configuration. Change-Id: I8809767c679c377e319ecc53960c55ae18e1b558 --- fluentd/templates/configmap-etc.yaml | 2 +- fluentd/values.yaml | 3 ++- tools/deployment/common/fluentd-daemonset.sh | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/fluentd/templates/configmap-etc.yaml b/fluentd/templates/configmap-etc.yaml index 4d88e1f8c..ee28709e3 100644 --- a/fluentd/templates/configmap-etc.yaml +++ b/fluentd/templates/configmap-etc.yaml @@ -23,5 +23,5 @@ metadata: name: {{ printf "%s-%s" $envAll.Release.Name "fluentd-etc" | quote }} type: Opaque data: - fluent.conf: {{ .Values.conf.fluentd.template | b64enc }} +{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.fluentd.template "key" "fluent.conf" "format" "Secret") | indent 2 }} {{- end }} diff --git a/fluentd/values.yaml b/fluentd/values.yaml index cd95a2b46..e740a1a0e 100644 --- a/fluentd/values.yaml +++ b/fluentd/values.yaml @@ -59,10 +59,11 @@ dependencies: conf: fluentd: + # This field is now rendered as a helm template! template: | @type prometheus - port 24231 + port {{ tuple "fluentd" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} diff --git a/tools/deployment/common/fluentd-daemonset.sh b/tools/deployment/common/fluentd-daemonset.sh index e17bbac29..f78114ac7 100755 --- a/tools/deployment/common/fluentd-daemonset.sh +++ b/tools/deployment/common/fluentd-daemonset.sh @@ -40,10 +40,11 @@ deployment: type: DaemonSet conf: fluentd: + # This field is now rendered as a helm template! template: | @type prometheus - port 24231 + port {{ tuple "fluentd" "internal" "metrics" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }}