From 56d3c33402a13682349f8775489d6973c2356b1e Mon Sep 17 00:00:00 2001 From: Nicole Date: Tue, 6 Feb 2024 17:32:39 -0700 Subject: [PATCH] [prometheus-node-exporter] Add Support for Environment Variables for KubeRBACProxy Container (#4202) * add support for env vars for kuberbacproxy container Signed-off-by: Nicole * remove extra space in env braces Signed-off-by: Nicole * rebase from main and change env var for krp to with from if Signed-off-by: Nicole * update version Signed-off-by: Nicole * syntax fix Signed-off-by: Nicole --------- Signed-off-by: Nicole --- charts/prometheus-node-exporter/Chart.yaml | 2 +- charts/prometheus-node-exporter/templates/daemonset.yaml | 7 +++++++ charts/prometheus-node-exporter/values.yaml | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/charts/prometheus-node-exporter/Chart.yaml b/charts/prometheus-node-exporter/Chart.yaml index 7abe42bbcf85..5e54656ed41c 100644 --- a/charts/prometheus-node-exporter/Chart.yaml +++ b/charts/prometheus-node-exporter/Chart.yaml @@ -6,7 +6,7 @@ keywords: - prometheus - exporter type: application -version: 4.28.0 +version: 4.29.0 appVersion: 1.7.0 home: https://github.com/prometheus/node_exporter/ sources: diff --git a/charts/prometheus-node-exporter/templates/daemonset.yaml b/charts/prometheus-node-exporter/templates/daemonset.yaml index 77b578d562d4..c43616e61d2f 100644 --- a/charts/prometheus-node-exporter/templates/daemonset.yaml +++ b/charts/prometheus-node-exporter/templates/daemonset.yaml @@ -230,6 +230,13 @@ spec: terminationMessagePolicy: {{ .terminationMessagePolicy }} {{- end }} {{- end }} + {{- with .Values.kubeRBACProxy.env }} + env: + {{- range $key, $value := $.Values.kubeRBACProxy.env }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} + {{- end }} {{- if .Values.kubeRBACProxy.containerSecurityContext }} securityContext: {{ toYaml .Values.kubeRBACProxy.containerSecurityContext | nindent 12 }} diff --git a/charts/prometheus-node-exporter/values.yaml b/charts/prometheus-node-exporter/values.yaml index 6b81b6c8aaf4..6d5e31e12a7a 100644 --- a/charts/prometheus-node-exporter/values.yaml +++ b/charts/prometheus-node-exporter/values.yaml @@ -39,6 +39,9 @@ global: # The requests are served through the same service but requests are HTTPS. kubeRBACProxy: enabled: false + ## Set environment variables as name/value pairs + env: {} + # VARIABLE: value image: registry: quay.io repository: brancz/kube-rbac-proxy