From 04a5ff8099772dbaf4fcf381deaddeae733aefab Mon Sep 17 00:00:00 2001 From: Marc Lallaouret Date: Thu, 25 Nov 2021 09:58:57 +0100 Subject: [PATCH] [grafana] Add SCRIPT environment variable to grafana dashboard sidecar container Signed-off-by: Marc Lallaouret --- charts/grafana/Chart.yaml | 2 +- charts/grafana/README.md | 1 + charts/grafana/templates/_pod.tpl | 4 ++++ charts/grafana/values.yaml | 2 ++ 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/charts/grafana/Chart.yaml b/charts/grafana/Chart.yaml index eeea2fc316..a7978f6a7c 100644 --- a/charts/grafana/Chart.yaml +++ b/charts/grafana/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: grafana -version: 6.17.7 +version: 6.17.8 appVersion: 8.2.5 kubeVersion: "^1.8.0-0" description: The leading tool for querying and visualizing time series and metrics. diff --git a/charts/grafana/README.md b/charts/grafana/README.md index 729aa23585..41e45229d7 100644 --- a/charts/grafana/README.md +++ b/charts/grafana/README.md @@ -159,6 +159,7 @@ This version requires Helm >= 3.1.0. | `sidecar.dashboards.folderAnnotation` | The annotation the sidecar will look for in configmaps to override the destination folder for files | `nil` | | `sidecar.dashboards.defaultFolderName` | The default folder name, it will create a subfolder under the `sidecar.dashboards.folder` and put dashboards in there instead | `nil` | | `sidecar.dashboards.searchNamespace` | Namespaces list. If specified, the sidecar will search for dashboards config-maps inside these namespaces.Otherwise the namespace in which the sidecar is running will be used.It's also possible to specify ALL to search in all namespaces. | `nil` | +| `sidecar.dashboards.script` | Absolute path to shell script to execute after a configmap got reloaded. | `nil` | | `sidecar.dashboards.resource` | Should the sidecar looks into secrets, configmaps or both. | `both` | | `sidecar.datasources.enabled` | Enables the cluster wide search for datasources and adds/updates/deletes them in grafana |`false` | | `sidecar.datasources.label` | Label that config maps with datasources should have to be added | `grafana_datasource` | diff --git a/charts/grafana/templates/_pod.tpl b/charts/grafana/templates/_pod.tpl index f0c5abebc4..8a3305ab96 100644 --- a/charts/grafana/templates/_pod.tpl +++ b/charts/grafana/templates/_pod.tpl @@ -199,6 +199,10 @@ containers: - name: FOLDER_ANNOTATION value: "{{ .Values.sidecar.dashboards.folderAnnotation }}" {{- end }} + {{- if .Values.sidecar.dashboards.script }} + - name: SCRIPT + value: "{{ .Values.sidecar.dashboards.script }}" + {{- end }} resources: {{ toYaml .Values.sidecar.resources | indent 6 }} volumeMounts: diff --git a/charts/grafana/values.yaml b/charts/grafana/values.yaml index 4cfd410e25..83b4ac799d 100644 --- a/charts/grafana/values.yaml +++ b/charts/grafana/values.yaml @@ -650,6 +650,8 @@ sidecar: # If specified, the sidecar will look for annotation with this name to create folder and put graph here. # You can use this parameter together with `provider.foldersFromFilesStructure`to annotate configmaps and create folder structure. folderAnnotation: null + # Absolute path to shell script to execute after a configmap got reloaded + script: null # provider configuration that lets grafana manage the dashboards provider: # name of the provider, should be unique