Refactor Distributed Analytics project structure
[demo.git] / vnfs / DAaaS / deploy / visualization / charts / grafana / templates / clusterrole.yaml
diff --git a/vnfs/DAaaS/deploy/visualization/charts/grafana/templates/clusterrole.yaml b/vnfs/DAaaS/deploy/visualization/charts/grafana/templates/clusterrole.yaml
new file mode 100755 (executable)
index 0000000..ccfc723
--- /dev/null
@@ -0,0 +1,23 @@
+{{- if and .Values.rbac.create (not .Values.rbac.namespaced) }}
+kind: ClusterRole
+apiVersion: rbac.authorization.k8s.io/v1
+metadata:
+  labels:
+    app: {{ template "grafana.name" . }}
+    chart: {{ template "grafana.chart" . }}
+    release: {{ .Release.Name }}
+    heritage: {{ .Release.Service }}
+{{- with .Values.annotations }}
+  annotations:
+{{ toYaml . | indent 4 }}
+{{- end }}
+  name: {{ template "grafana.fullname" . }}-clusterrole
+{{- if or .Values.sidecar.dashboards.enabled .Values.sidecar.datasources.enabled }}
+rules:
+- apiGroups: [""] # "" indicates the core API group
+  resources: ["configmaps"]
+  verbs: ["get", "watch", "list"]
+{{- else }}
+rules: []
+{{- end}}
+{{- end}}