From 7fa6664749c3e5f545374dd6f524ad56daf01c6f Mon Sep 17 00:00:00 2001 From: olegy2008 Date: Tue, 6 Oct 2020 21:28:37 +0300 Subject: [PATCH] Signed-off-by: olegy2008 Add additional blackbox-exporter container environment variables --- charts/prometheus-blackbox-exporter/Chart.yaml | 2 +- .../prometheus-blackbox-exporter/ci/extraenv-values.yaml | 3 +++ .../prometheus-blackbox-exporter/templates/daemonset.yaml | 5 +++++ .../templates/deployment.yaml | 5 +++++ charts/prometheus-blackbox-exporter/values.yaml | 8 ++++++++ 5 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 charts/prometheus-blackbox-exporter/ci/extraenv-values.yaml diff --git a/charts/prometheus-blackbox-exporter/Chart.yaml b/charts/prometheus-blackbox-exporter/Chart.yaml index 520e7037f3a1..bca6b6af1d32 100644 --- a/charts/prometheus-blackbox-exporter/Chart.yaml +++ b/charts/prometheus-blackbox-exporter/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: Prometheus Blackbox Exporter name: prometheus-blackbox-exporter -version: 4.6.0 +version: 4.7.0 appVersion: 0.17.0 home: https://github.com/prometheus/blackbox_exporter sources: diff --git a/charts/prometheus-blackbox-exporter/ci/extraenv-values.yaml b/charts/prometheus-blackbox-exporter/ci/extraenv-values.yaml new file mode 100644 index 000000000000..c0050833014d --- /dev/null +++ b/charts/prometheus-blackbox-exporter/ci/extraenv-values.yaml @@ -0,0 +1,3 @@ +extraEnv: + HTTP_PROXY: "http://superproxy.com:3128" + NO_PROXY: "localhost,127.0.0.1" \ No newline at end of file diff --git a/charts/prometheus-blackbox-exporter/templates/daemonset.yaml b/charts/prometheus-blackbox-exporter/templates/daemonset.yaml index ee6bb49ebf14..0927a84ac083 100644 --- a/charts/prometheus-blackbox-exporter/templates/daemonset.yaml +++ b/charts/prometheus-blackbox-exporter/templates/daemonset.yaml @@ -62,6 +62,11 @@ spec: readOnlyRootFilesystem: {{ .Values.readOnlyRootFilesystem }} runAsNonRoot: {{ .Values.runAsNonRoot }} runAsUser: {{ .Values.runAsUser }} + env: + {{- range $key, $value := .Values.extraEnv }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} args: {{- if .Values.config }} - "--config.file=/config/blackbox.yaml" diff --git a/charts/prometheus-blackbox-exporter/templates/deployment.yaml b/charts/prometheus-blackbox-exporter/templates/deployment.yaml index 6b07baf4e829..ba58aafacbe1 100644 --- a/charts/prometheus-blackbox-exporter/templates/deployment.yaml +++ b/charts/prometheus-blackbox-exporter/templates/deployment.yaml @@ -70,6 +70,11 @@ spec: runAsNonRoot: {{ .Values.runAsNonRoot }} runAsUser: {{ .Values.runAsUser }} {{- end }} + env: + {{- range $key, $value := .Values.extraEnv }} + - name: {{ $key }} + value: {{ $value | quote }} + {{- end }} args: {{- if .Values.config }} - "--config.file=/config/blackbox.yaml" diff --git a/charts/prometheus-blackbox-exporter/values.yaml b/charts/prometheus-blackbox-exporter/values.yaml index 564ef2efee28..4d395d1915ce 100644 --- a/charts/prometheus-blackbox-exporter/values.yaml +++ b/charts/prometheus-blackbox-exporter/values.yaml @@ -5,6 +5,14 @@ kind: Deployment podDisruptionBudget: {} # maxUnavailable: 0 +## Additional blackbox-exporter container environment variables +## For instance to add a http_proxy +## +## extraEnv: +## HTTP_PROXY: "http://superproxy.com:3128" +## NO_PROXY: "localhost,127.0.0.1" +extraEnv: {} + ## Enable pod security policy pspEnabled: true