Files
service-catalog/manifests/helm/strimzi-kafka-operator/0.47.0/templates/090-ConfigMap-strimzi-grafana-dashboards.yaml
T
2026-01-19 16:11:44 +09:00

27 lines
925 B
YAML

{{- 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 }}