seaweedfs-grafana-dashboard.yaml 572 B

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