You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
572 B

  1. {{- if .Values.global.monitoring.enabled }}
  2. {{- $files := .Files.Glob "dashboards/*.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" $dashboardName | lower | replace "_" "-" }}
  13. namespace: {{ $.Release.Namespace }}
  14. labels:
  15. grafana_dashboard: "1"
  16. data:
  17. {{ $dashboardName }}.json: {{ $.Files.Get $path | toJson }}
  18. {{- end }}
  19. {{- end }}
  20. {{- end }}