From 3352ef86286a7e8f07266ff3da1a575aa7368c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Tr=C3=B6litzsch?= <46501118+marcfrederick@users.noreply.github.com> Date: Tue, 5 Sep 2023 19:54:59 +0200 Subject: [PATCH] [prometheus-kafka-exporter] add support for valueFrom in env variables (#3754) Signed-off-by: Marc Troelitzsch --- charts/prometheus-kafka-exporter/Chart.yaml | 2 +- .../templates/deployment.yaml | 5 ++--- charts/prometheus-kafka-exporter/values.yaml | 13 +++++++++++-- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/charts/prometheus-kafka-exporter/Chart.yaml b/charts/prometheus-kafka-exporter/Chart.yaml index 2505dd6990bf..8e9b6c4a91b1 100644 --- a/charts/prometheus-kafka-exporter/Chart.yaml +++ b/charts/prometheus-kafka-exporter/Chart.yaml @@ -3,7 +3,7 @@ appVersion: "v1.6.0" description: A Helm chart to export the metrics from Kafka in Prometheus format using the kafka-exporter from https://github.com/danielqsj/kafka_exporter name: prometheus-kafka-exporter home: https://github.com/danielqsj/kafka_exporter -version: 2.3.0 +version: 2.4.0 kubeVersion: ">=1.19.0-0" sources: - https://gkarthiks.github.io/helm-charts/charts/prometheus-kafka-exporter diff --git a/charts/prometheus-kafka-exporter/templates/deployment.yaml b/charts/prometheus-kafka-exporter/templates/deployment.yaml index 19a86115589a..21ee7be8253f 100644 --- a/charts/prometheus-kafka-exporter/templates/deployment.yaml +++ b/charts/prometheus-kafka-exporter/templates/deployment.yaml @@ -81,9 +81,8 @@ spec: {{- end }} {{- end }} env: - {{- range $env := .Values.env }} - - name: {{ $env.name }} - value: {{ $env.value }} + {{- with .Values.env }} + {{- toYaml . | nindent 12 }} {{- end }} {{- if .Values.sasl.scram.enabled }} - name: SCRAM_USERNAME diff --git a/charts/prometheus-kafka-exporter/values.yaml b/charts/prometheus-kafka-exporter/values.yaml index 618898a02561..9244a9e14b48 100644 --- a/charts/prometheus-kafka-exporter/values.yaml +++ b/charts/prometheus-kafka-exporter/values.yaml @@ -48,9 +48,18 @@ serviceAccount: # If not set and create is true, a name is generated using the fullname template name: +# Specifies environment variables to be added to the kafka-exporter container. +# Environment variables can be defined as a list of either key-value pairs or +# using valueFrom to reference a secret or config map. env: [] -# - name: -# value: + # - name: + # value: + # - name: PASSWORD + # valueFrom: + # secretKeyRef: + # name: mysecret + # key: password + # optional: false # List of additional cli arguments to configure kafka-exporter # for example: --log.enable-sarama, --log.level=debug, etc.