github.com/verrazzano/verrazzano@v1.7.0/platform-operator/thirdparty/charts/prometheus-community/kube-prometheus-stack/templates/grafana/configmap-dashboards.yaml (about)

     1  {{- if or (and .Values.grafana.enabled .Values.grafana.defaultDashboardsEnabled) .Values.grafana.forceDeployDashboards }}
     2  {{- $files := .Files.Glob "dashboards-1.14/*.json" }}
     3  {{- if $files }}
     4  apiVersion: v1
     5  kind: ConfigMapList
     6  items:
     7  {{- range $path, $fileContents := $files }}
     8  {{- $dashboardName := regexReplaceAll "(^.*/)(.*)\\.json$" $path "${2}" }}
     9  - apiVersion: v1
    10    kind: ConfigMap
    11    metadata:
    12      name: {{ printf "%s-%s" (include "kube-prometheus-stack.fullname" $) $dashboardName | trunc 63 | trimSuffix "-" }}
    13      namespace: {{ template "kube-prometheus-stack-grafana.namespace" $ }}
    14      labels:
    15        {{- if $.Values.grafana.sidecar.dashboards.label }}
    16        {{ $.Values.grafana.sidecar.dashboards.label }}: {{ ternary $.Values.grafana.sidecar.dashboards.labelValue "1" (not (empty $.Values.grafana.sidecar.dashboards.labelValue)) | quote }}
    17        {{- end }}
    18        app: {{ template "kube-prometheus-stack.name" $ }}-grafana
    19  {{ include "kube-prometheus-stack.labels" $ | indent 6 }}
    20    data:
    21      {{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
    22  {{- end }}
    23  {{- end }}
    24  {{- end }}