-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Option to Deploy Grafana Dashboards as ConfigMaps for Sidec…
…ar Discovery (#220) * Add grafana dashboard configmaps for the grafana dashboard sidecar * make docs...again * changed grafana installation to sidecar approach * refactroings
- Loading branch information
1 parent
0328d1f
commit cf83f1f
Showing
4 changed files
with
52 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 19 additions & 8 deletions
27
charts/greptimedb-cluster/templates/grafana-dashboards-configmap.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
{{- if .Values.grafana.enabled }} | ||
{{- $root := . -}} | ||
{{- range $key, $value := .Values.grafana.dashboardsConfigMaps }} | ||
{{- if or .Values.grafana.enabled .Values.dashboards.enabled }} | ||
{{ $root := . }} | ||
{{- range $path, $_ := .Files.Glob "dashboards/**.json" }} | ||
--- | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ $value }} | ||
namespace: {{ $root.Release.Namespace }} | ||
labels: | ||
component: grafana-dashboards | ||
{{- if $.Values.dashboards.label }} | ||
{{ $.Values.dashboards.label }}: {{ ternary $.Values.dashboards.labelValue "1" (not (empty $.Values.dashboards.labelValue)) | quote }} | ||
{{- end }} | ||
{{- include "greptimedb-cluster.labels" $root | nindent 4 }} | ||
{{- with $.Values.dashboards.extraLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
{{- with $.Values.dashboards.annotations }} | ||
annotations: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
name: dashboard-{{ (base $path | replace ".json" "" | trunc 63 | replace "_" "-") }} | ||
namespace: {{ $.Values.dashboards.namespace | default $.Release.Namespace }} | ||
data: | ||
{{ $key }}.json: |- | ||
{{ $root.Files.Get (printf "dashboards/%s.json" $key) | indent 4 }} | ||
--- | ||
{{ (base $path | replace ".json" "" | trunc 63 | replace "_" "-" | lower | indent 2) }}.json: | | ||
{{ $root.Files.Get $path | indent 4 }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters