kubeasz/manifests/prometheus/grafana/templates/dashboards-json-configmap.yaml

23 lines
598 B
YAML
Raw Normal View History

{{- if .Values.dashboards }}
{{- range $provider, $dashboards := .Values.dashboards }}
---
2018-06-05 19:23:47 +08:00
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "grafana.fullname" $ }}-dashboards-{{ $provider }}
2018-06-05 19:23:47 +08:00
labels:
app: {{ template "grafana.name" $ }}
chart: {{ template "grafana.chart" $ }}
release: {{ $.Release.Name }}
heritage: {{ $.Release.Service }}
dashboard-provider: {{ $provider }}
2018-06-05 19:23:47 +08:00
data:
{{- range $key, $value := $dashboards }}
2018-06-05 19:23:47 +08:00
{{- if hasKey $value "json" }}
{{ $key }}.json: |
{{ $value.json | indent 4 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}