From a4816feda2cf23f02883ddf7317c63a2190f042e Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Wed, 20 Nov 2019 09:58:12 -0600 Subject: [PATCH] Grafana: Add support for arbitrary environment variables This updates the Grafana chart to support the definition of arbitrary environment variables to support scenarios where additional information may be required at runtime for things like datasource and dashboard provisioning Change-Id: I95e4abe9030116a440c6d78a1d14dbcaaf743b40 Signed-off-by: Steve Wilkerson --- grafana/templates/deployment.yaml | 3 +++ grafana/values.yaml | 2 ++ 2 files changed, 5 insertions(+) diff --git a/grafana/templates/deployment.yaml b/grafana/templates/deployment.yaml index 80e7e01b0..6b9911d0c 100644 --- a/grafana/templates/deployment.yaml +++ b/grafana/templates/deployment.yaml @@ -83,6 +83,9 @@ spec: key: GRAFANA_ADMIN_PASSWORD - name: PROMETHEUS_URL value: {{ tuple "monitoring" "internal" "api" $envAll | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }} +{{- if .Values.pod.env.grafana }} +{{ include "helm-toolkit.utils.to_k8s_env_vars" .Values.pod.env.grafana | indent 12 }} +{{- end }} volumeMounts: - name: pod-tmp mountPath: /tmp diff --git a/grafana/values.yaml b/grafana/values.yaml index a6ad3d89a..a15ec2c20 100644 --- a/grafana/values.yaml +++ b/grafana/values.yaml @@ -43,6 +43,8 @@ labels: node_selector_value: enabled pod: + env: + grafana: null security_context: dashboard: pod: