2020-03-03 15:56:39 +08:00
|
|
|
{{- if .Values.global.monitoring.enabled }}
|
2020-11-07 23:40:59 +08:00
|
|
|
{{- $files := .Files.Glob "dashboards/*.json" }}
|
|
|
|
{{- if $files }}
|
2020-03-03 15:56:39 +08:00
|
|
|
apiVersion: v1
|
2020-11-07 23:40:59 +08:00
|
|
|
kind: ConfigMapList
|
|
|
|
items:
|
|
|
|
{{- range $path, $fileContents := $files }}
|
|
|
|
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
|
|
|
|
- apiVersion: v1
|
|
|
|
kind: ConfigMap
|
|
|
|
metadata:
|
|
|
|
name: {{ printf "%s" $dashboardName | lower | replace "_" "-" }}
|
|
|
|
namespace: {{ $.Release.Namespace }}
|
|
|
|
labels:
|
|
|
|
grafana_dashboard: "1"
|
|
|
|
data:
|
|
|
|
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
|
2020-09-10 14:28:21 +08:00
|
|
|
{{- end }}
|
2020-11-07 23:40:59 +08:00
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|