From 9b00f330b3bee3584593b7e2253f56a91e129712 Mon Sep 17 00:00:00 2001 From: Raffael H Date: Tue, 10 Oct 2023 14:14:10 +0200 Subject: [PATCH] Update grafana datasource to be dynamically added --- charts/user-monitoring/Chart.yaml | 2 +- .../templates/_user-grafana-datasource-secret.yaml | 3 +++ charts/user-monitoring/values.yaml | 8 +++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/charts/user-monitoring/Chart.yaml b/charts/user-monitoring/Chart.yaml index a9226fa..3d8125e 100644 --- a/charts/user-monitoring/Chart.yaml +++ b/charts/user-monitoring/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.3 +version: 0.2.4 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/user-monitoring/templates/_user-grafana-datasource-secret.yaml b/charts/user-monitoring/templates/_user-grafana-datasource-secret.yaml index d722308..f9554ce 100644 --- a/charts/user-monitoring/templates/_user-grafana-datasource-secret.yaml +++ b/charts/user-monitoring/templates/_user-grafana-datasource-secret.yaml @@ -18,4 +18,7 @@ stringData: type: prometheus url: http://thanos-query.{{ .Values.user }}-monitoring.svc.cluster.local:10902 version: 1 + {{- if .Values.grafana.datasources }} + {{- toYaml .Values.grafana.datasources | nindent 6 }} + {{- end }} {{- end }} \ No newline at end of file diff --git a/charts/user-monitoring/values.yaml b/charts/user-monitoring/values.yaml index 8716483..f86eced 100644 --- a/charts/user-monitoring/values.yaml +++ b/charts/user-monitoring/values.yaml @@ -6,7 +6,13 @@ alertmanager: # grafana grafana: - enabled: false + datasources: + - name: prometheus + access: proxy + editable: false + type: prometheus + url: http://prometheus-operated.user4-monitoring.svc.cluster.local:9090 + enabled: true # prometheus prometheus: