summaryrefslogtreecommitdiffstats
path: root/vnfs/DAaaS/visualization/charts/grafana/templates/dashboards-json-configmap.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'vnfs/DAaaS/visualization/charts/grafana/templates/dashboards-json-configmap.yaml')
-rwxr-xr-xvnfs/DAaaS/visualization/charts/grafana/templates/dashboards-json-configmap.yaml28
1 files changed, 28 insertions, 0 deletions
diff --git a/vnfs/DAaaS/visualization/charts/grafana/templates/dashboards-json-configmap.yaml b/vnfs/DAaaS/visualization/charts/grafana/templates/dashboards-json-configmap.yaml
new file mode 100755
index 00000000..bd46addc
--- /dev/null
+++ b/vnfs/DAaaS/visualization/charts/grafana/templates/dashboards-json-configmap.yaml
@@ -0,0 +1,28 @@
+{{- if .Values.dashboards }}
+{{ $files := .Files }}
+{{- range $provider, $dashboards := .Values.dashboards }}
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+ name: {{ template "grafana.fullname" $ }}-dashboards-{{ $provider }}
+ labels:
+ app: {{ template "grafana.name" $ }}
+ chart: {{ template "grafana.chart" $ }}
+ release: {{ $.Release.Name }}
+ heritage: {{ $.Release.Service }}
+ dashboard-provider: {{ $provider }}
+data:
+{{- range $key, $value := $dashboards }}
+{{- if (or (hasKey $value "json") (hasKey $value "file")) }}
+{{ print $key | indent 2 }}.json: |-
+{{- if hasKey $value "json" }}
+{{ $value.json | indent 4 }}
+{{- end }}
+{{- if hasKey $value "file" }}
+{{ toYaml ( $files.Get $value.file ) | indent 4}}
+{{- end }}
+{{- end }}
+{{- end }}
+{{- end }}
+{{- end }}