2021-06-30 16:26:06 +00:00
|
|
|
{{- if or (and .Values.grafana.enabled .Values.grafana.defaultDashboardsEnabled) .Values.grafana.forceDeployDashboards }}
|
2021-06-01 16:40:34 +00:00
|
|
|
{{- $files := .Files.Glob "dashboards-1.14/*.json" }}
|
2020-12-18 00:46:15 +00:00
|
|
|
{{- if $files }}
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ConfigMapList
|
|
|
|
items:
|
|
|
|
{{- range $path, $fileContents := $files }}
|
|
|
|
{{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
|
|
|
|
- apiVersion: v1
|
|
|
|
kind: ConfigMap
|
|
|
|
metadata:
|
|
|
|
name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" $) $dashboardName | trunc 63 | trimSuffix "-" }}
|
2021-12-09 18:03:55 +00:00
|
|
|
namespace: {{ template "kube-prometheus-stack-grafana.namespace" $ }}
|
2020-12-18 00:46:15 +00:00
|
|
|
labels:
|
|
|
|
{{- if $.Values.grafana.sidecar.dashboards.label }}
|
2022-04-08 15:08:28 +00:00
|
|
|
{{ $.Values.grafana.sidecar.dashboards.label }}: {{ ternary $.Values.grafana.sidecar.dashboards.labelValue "1" (not (empty $.Values.grafana.sidecar.dashboards.labelValue)) | quote }}
|
2020-12-18 00:46:15 +00:00
|
|
|
{{- end }}
|
|
|
|
app: {{ template "kube-prometheus-stack.name" $ }}-grafana
|
|
|
|
{{ include "kube-prometheus-stack.labels" $ | indent 6 }}
|
|
|
|
data:
|
|
|
|
{{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|