Skip to content

Commit a1a704d

Browse files
authored
Merge pull request #244 from vmercierfr/grafana-dashboard-cross-namespace
Support deployment in non Grafana namespace
2 parents 2411b1e + 9289340 commit a1a704d

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

configs/helm/templates/grafanadashboard.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ kind: GrafanaDashboard
88
metadata:
99
name: {{ $path | base | trimSuffix ".json" }}
1010
spec:
11+
allowCrossNamespaceImport: {{ .Values.dashboards.allowCrossNamespaceImport }}
1112
resyncPeriod: {{ .Values.dashboards.resyncPeriod }}
1213
folder: {{ .Values.dashboards.folderName }}
1314
instanceSelector:

configs/helm/tests/grafanadashboard_test.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ tests:
2828
equal:
2929
path: metadata.name
3030
value: rds-instances
31+
- equal:
32+
path: spec.allowCrossNamespaceImport
33+
value: true
3134
- equal:
3235
path: spec.resyncPeriod
3336
value: 24h
@@ -41,6 +44,9 @@ tests:
4144
values:
4245
- ./values/with_grafanadashboards_custom.yaml
4346
asserts:
47+
- equal:
48+
path: spec.allowCrossNamespaceImport
49+
value: false
4450
- equal:
4551
path: spec.resyncPeriod
4652
value: 1m
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
---
22
dashboards:
33
enabled: true
4+
allowCrossNamespaceImport: false # Disable cross namespace dashboard import
45
resyncPeriod: 1m
56
instanceSelector: my-grafana
67
folderName: dmf

configs/helm/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ affinity: {}
9292

9393
dashboards:
9494
enabled: false # enabled GrafanaDashboard CRD import
95+
allowCrossNamespaceImport: true # define if Grafana operator can loads dashboards when stored in a different namespace
9596
resyncPeriod: 24h # how often the dashboard is refreshed
9697
instanceSelector: grafana # selects Grafana for import
9798
folderName: # folder assignment for dashboard

0 commit comments

Comments
 (0)