-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #155 from qonto/add-grafana-crd
Add Grafana dashboard CRD
- Loading branch information
Showing
11 changed files
with
470 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../grafana/public |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{- if .Values.dashboards.enabled -}} | ||
{{ $currentScope := .}} | ||
{{ range $path, $_ := .Files.Glob "grafana_dashboards/**.json" }} | ||
{{- with $currentScope}} | ||
--- | ||
apiVersion: grafana.integreatly.org/v1beta1 | ||
kind: GrafanaDashboard | ||
metadata: | ||
name: {{ $path | base | trimSuffix ".json" }} | ||
spec: | ||
resyncPeriod: {{ .Values.dashboards.resyncPeriod }} | ||
folder: {{ .Values.dashboards.folderName }} | ||
instanceSelector: | ||
matchLabels: | ||
dashboards: {{ .Values.dashboards.instanceSelector }} | ||
json: | | ||
{{ .Files.Get $path | indent 4 }} | ||
{{- end }} | ||
{{- 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json | ||
--- | ||
suite: grafana dashboard tests | ||
templates: | ||
- grafanadashboard.yaml | ||
tests: | ||
- it: render default Grafana dashboards | ||
asserts: | ||
- isKind: | ||
of: GrafanaDashboard | ||
- hasDocuments: | ||
count: 3 | ||
- documentIndex: 0 | ||
equal: | ||
path: metadata.name | ||
value: prometheus-rds-exporter | ||
- documentIndex: 1 | ||
equal: | ||
path: metadata.name | ||
value: rds-instance | ||
- documentIndex: 2 | ||
equal: | ||
path: metadata.name | ||
value: rds-instances | ||
- equal: | ||
path: spec.resyncPeriod | ||
value: 24h | ||
- equal: | ||
path: spec.folder | ||
value: | ||
- equal: | ||
path: spec.instanceSelector.matchLabels.dashboards | ||
value: grafana | ||
- it: render custom Grafana dashboards settings | ||
values: | ||
- ./values/with_grafanadashboards.yaml | ||
asserts: | ||
- equal: | ||
path: spec.resyncPeriod | ||
value: 1m | ||
- equal: | ||
path: spec.folder | ||
value: dmf | ||
- equal: | ||
path: spec.instanceSelector.matchLabels.dashboards | ||
value: my-grafana | ||
- it: disable Grafana dashboards | ||
values: | ||
- ./values/without_grafanadashboards.yaml | ||
asserts: | ||
- hasDocuments: | ||
count: 0 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
dashboards: | ||
resyncPeriod: 1m | ||
instanceSelector: my-grafana | ||
folderName: dmf |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
dashboards: | ||
enabled: false |
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
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Note for later | ||
|
||
Grafana dashboards CRD is required until <https://github.com/datreeio/CRDs-catalog/pull/285> is merged |
Oops, something went wrong.