Add Alertmanager dashboard to Grafana

This patch set adds a new Alertmanager dashboard to Grafana.  Note
that a new configmap is created for this instead of using the
same configmap which includes all the dashboards. Using the same
configmap will eventually run into issue with configmap size limitation.

Change-Id: I10561c0b0b464c3b67d4a738f9f2cb70ef601b3d
This commit is contained in:
Lo, Chi (cl566n) 2021-08-02 12:31:43 -07:00
parent f26d4db145
commit 5a290e1d83
5 changed files with 42 additions and 1 deletions

View File

@ -15,7 +15,7 @@ apiVersion: v1
appVersion: v7.4.5 appVersion: v7.4.5
description: OpenStack-Helm Grafana description: OpenStack-Helm Grafana
name: grafana name: grafana
version: 0.1.8 version: 0.1.9
home: https://grafana.com/ home: https://grafana.com/
sources: sources:
- https://github.com/grafana/grafana - https://github.com/grafana/grafana

View File

@ -0,0 +1,25 @@
{{/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/}}
{{- if .Values.manifests.configmap_dashboards_alertmanager }}
---
apiVersion: v1
kind: ConfigMap
metadata:
name: grafana-dashboards-alertmanager
data:
{{ range $key, $value := .Values.conf.dashboards_alertmanager }}
{{$key}}.json: {{ $value | toJson }}
{{ end }}
{{- end }}

View File

@ -125,6 +125,13 @@ spec:
mountPath: /etc/grafana/dashboards/{{$key}}.json mountPath: /etc/grafana/dashboards/{{$key}}.json
subPath: {{$key}}.json subPath: {{$key}}.json
{{- end }} {{- end }}
{{- if .Values.manifests.configmap_dashboards_alertmanager }}
{{- range $key, $value := .Values.conf.dashboards_alertmanager }}
- name: grafana-dashboards-alertmanager
mountPath: /etc/grafana/dashboards/{{$key}}.json
subPath: {{$key}}.json
{{- end }}
{{- end }}
{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal "path" "/etc/mysql/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }} {{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal "path" "/etc/mysql/certs" | include "helm-toolkit.snippets.tls_volume_mount" | indent 12 }}
{{ if $mounts_grafana.volumeMounts }}{{ toYaml $mounts_grafana.volumeMounts | indent 12 }}{{ end }} {{ if $mounts_grafana.volumeMounts }}{{ toYaml $mounts_grafana.volumeMounts | indent 12 }}{{ end }}
volumes: volumes:
@ -150,6 +157,12 @@ spec:
configMap: configMap:
name: grafana-dashboards name: grafana-dashboards
defaultMode: 0555 defaultMode: 0555
{{- if .Values.manifests.configmap_dashboards_alertmanager }}
- name: grafana-dashboards-alertmanager
configMap:
name: grafana-dashboards-alertmanager
defaultMode: 0555
{{- end }}
- name: data - name: data
emptyDir: {} emptyDir: {}
{{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }} {{- dict "enabled" $envAll.Values.manifests.certificates "name" $envAll.Values.endpoints.oslo_db.auth.admin.secret.tls.internal | include "helm-toolkit.snippets.tls_volume" | indent 8 }}

View File

@ -367,6 +367,7 @@ manifests:
configmap_bin: true configmap_bin: true
configmap_etc: true configmap_etc: true
configmap_dashboards: true configmap_dashboards: true
configmap_dashboards_alertmanager: false
deployment: true deployment: true
ingress: true ingress: true
helm_tests: true helm_tests: true
@ -485,4 +486,5 @@ conf:
grafana_net: grafana_net:
url: https://grafana.net url: https://grafana.net
dashboards: {} dashboards: {}
dashboards_alertmanager: {}
... ...

View File

@ -9,4 +9,5 @@ grafana:
- 0.1.6 Enable TLS for Grafana ingress path - 0.1.6 Enable TLS for Grafana ingress path
- 0.1.7 Update Grafana version and Selenium script - 0.1.7 Update Grafana version and Selenium script
- 0.1.8 Use full image ref for docker official images - 0.1.8 Use full image ref for docker official images
- 0.1.9 Add Alertmanager dashboard to Grafana
... ...