From 818c475f1da4ab36ecbac73e79a879e4c4a3e82a Mon Sep 17 00:00:00 2001 From: "Ritchie, Frank (fr801x)" Date: Tue, 23 Aug 2022 16:14:27 -0400 Subject: [PATCH] Grafana 8.5.10 with unified alerting This PS updates Grafana to 8.5.10 and enables unified alerting which will be the default in 9.x. The following directories are required for unified alerting: /var/lib/grafana/alerting /var/lib/grafana/csv If a user is upgrading from Grafana 7.x and wants to opt out of unified alerting they will need to set: [alerting] enabled = true [unified_alerting] enabled = false in grafana.ini. Additionally, to roll back, the env var GF_DEFAULT_FORCE_MIGRATION: true needs to be set for the grafana_run_migrator pod. Unified alerting doc: https://grafana.com/docs/grafana/v9.0/alerting/migrating-alerts/ Change-Id: I3a6ca005b9d9433e958802e7e978b81479a16fb8 --- grafana/Chart.yaml | 4 ++-- grafana/templates/deployment.yaml | 8 ++++++++ grafana/templates/job-run-migrator.yaml | 11 +++++++++++ grafana/values.yaml | 10 +++++++++- releasenotes/notes/grafana.yaml | 1 + 5 files changed, 31 insertions(+), 3 deletions(-) diff --git a/grafana/Chart.yaml b/grafana/Chart.yaml index d60180fca..f20017057 100644 --- a/grafana/Chart.yaml +++ b/grafana/Chart.yaml @@ -12,10 +12,10 @@ --- apiVersion: v1 -appVersion: v7.4.5 +appVersion: v8.5.10 description: OpenStack-Helm Grafana name: grafana -version: 0.1.15 +version: 0.1.16 home: https://grafana.com/ sources: - https://github.com/grafana/grafana diff --git a/grafana/templates/deployment.yaml b/grafana/templates/deployment.yaml index 665fcf2c3..c365a4b6b 100644 --- a/grafana/templates/deployment.yaml +++ b/grafana/templates/deployment.yaml @@ -102,6 +102,10 @@ spec: mountPath: /etc/grafana/dashboards - name: pod-provisioning-grafana mountPath: {{ .Values.conf.grafana.paths.provisioning }} + - name: pod-alerting-grafana + mountPath: {{ .Values.conf.grafana.paths.alerting }} + - name: pod-csv-grafana + mountPath: {{ .Values.conf.grafana.paths.csv }} - name: grafana-bin mountPath: /tmp/grafana.sh subPath: grafana.sh @@ -141,6 +145,10 @@ spec: emptyDir: {} - name: pod-provisioning-grafana emptyDir: {} + - name: pod-alerting-grafana + emptyDir: {} + - name: pod-csv-grafana + emptyDir: {} - name: grafana-bin configMap: name: grafana-bin diff --git a/grafana/templates/job-run-migrator.yaml b/grafana/templates/job-run-migrator.yaml index be9cce11e..86b3dce70 100644 --- a/grafana/templates/job-run-migrator.yaml +++ b/grafana/templates/job-run-migrator.yaml @@ -84,6 +84,9 @@ spec: {{- end }} {{- if .Values.pod.env.grafana }} {{ include "helm-toolkit.utils.to_k8s_env_vars" .Values.pod.env.grafana | indent 12 }} +{{- end }} +{{- if .Values.pod.env.grafana_run_migrator }} +{{ include "helm-toolkit.utils.to_k8s_env_vars" .Values.pod.env.grafana_run_migrator | indent 12 }} {{- end }} volumeMounts: - name: pod-tmp @@ -96,6 +99,10 @@ spec: mountPath: /etc/grafana/dashboards - name: pod-provisioning-grafana mountPath: {{ .Values.conf.grafana.paths.provisioning }} + - name: pod-alerting-grafana + mountPath: {{ .Values.conf.grafana.paths.alerting }} + - name: pod-csv-grafana + mountPath: {{ .Values.conf.grafana.paths.csv }} - name: grafana-bin mountPath: /tmp/grafana.sh subPath: grafana.sh @@ -135,6 +142,10 @@ spec: emptyDir: {} - name: pod-provisioning-grafana emptyDir: {} + - name: pod-alerting-grafana + emptyDir: {} + - name: pod-csv-grafana + emptyDir: {} - name: grafana-bin configMap: name: grafana-bin diff --git a/grafana/values.yaml b/grafana/values.yaml index 1093cae21..7bf5bfd21 100644 --- a/grafana/values.yaml +++ b/grafana/values.yaml @@ -17,7 +17,7 @@ --- images: tags: - grafana: docker.io/grafana/grafana:7.4.5 + grafana: docker.io/grafana/grafana:8.5.10 dep_check: quay.io/airshipit/kubernetes-entrypoint:v1.0.0 db_init: docker.io/openstackhelm/heat:stein-ubuntu_bionic grafana_db_session_sync: docker.io/openstackhelm/heat:stein-ubuntu_bionic @@ -44,6 +44,8 @@ labels: pod: env: grafana: null + grafana_run_migrator: + GF_DEFAULT_FORCE_MIGRATION: false security_context: dashboard: pod: @@ -485,6 +487,10 @@ conf: basicAuthPassword: {{ .Values.endpoints.monitoring.auth.user.password }} url: {{ tuple "monitoring" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }} grafana: + alerting: + enabled: false + unified_alerting: + enabled: true analytics: reporting_enabled: false check_for_updates: false @@ -494,6 +500,8 @@ conf: paths: data: /var/lib/grafana/data plugins: /var/lib/grafana/plugins + alerting: /var/lib/grafana/alerting + csv: /var/lib/grafana/csv provisioning: /etc/grafana/provisioning server: protocol: http diff --git a/releasenotes/notes/grafana.yaml b/releasenotes/notes/grafana.yaml index 20c41cfbd..6899580c2 100644 --- a/releasenotes/notes/grafana.yaml +++ b/releasenotes/notes/grafana.yaml @@ -16,4 +16,5 @@ grafana: - 0.1.13 Update prometheus metric name - 0.1.14 Add run migrator job - 0.1.15 Added OCI registry authentication + - 0.1.16 Grafana 8.5.10 with unified alerting ...