You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
925 B
26 lines
925 B
{{- if .Values.dashboards.enabled }}
|
|
{{- $files := .Files.Glob "files/grafana-dashboards/*.json" }}
|
|
{{- range $path, $fileContents := $files }}
|
|
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
|
|
---
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: {{ $dashboardName | trunc 63 | trimSuffix "-" }}
|
|
namespace: {{ $.Values.dashboards.namespace | default $.Release.Namespace }}
|
|
labels:
|
|
component: grafana-dashboards
|
|
{{- if $.Values.dashboards.label }}
|
|
{{ $.Values.dashboards.label }}: {{ ternary $.Values.dashboards.labelValue "1" (not (empty $.Values.dashboards.labelValue)) | quote }}
|
|
{{- end }}
|
|
{{- with $.Values.dashboards.extraLabels }}
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
{{- with $.Values.dashboards.annotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 4 }}
|
|
{{- end }}
|
|
data:
|
|
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|