Ref: https://github.com/helm/helm/issues/4157#issuecomment-490748085 Signed-off-by: rjshrjndrn <rjshrjndrn@gmail.com>
20 lines
589 B
YAML
20 lines
589 B
YAML
# Ref: https://github.com/helm/helm/issues/4157#issuecomment-490748085
|
|
{{- $processedDict := dict -}}
|
|
{{- range $path, $bytes := .Files.Glob "dashboards/**" }}
|
|
{{- $name := base (dir $path) }}
|
|
{{- if not (hasKey $processedDict $name) -}}
|
|
{{ $_ := set $processedDict $name "true" }}
|
|
apiVersion: v1
|
|
kind: ConfigMap
|
|
metadata:
|
|
name: dashboard-{{ $name }}
|
|
namespace: observability
|
|
labels:
|
|
app: kube-prometheus-stack-grafana
|
|
grafana_dashboard: "1"
|
|
release: observability
|
|
data:
|
|
{{ ($.Files.Glob (printf "dashboards/%s/*" $name)).AsConfig | indent 2 }}
|
|
---
|
|
{{- end }}
|
|
{{- end }}
|