summaryrefslogtreecommitdiffstats
path: root/vnfs/DAaaS/visualization/charts/grafana/templates/role.yaml
diff options
context:
space:
mode:
Diffstat (limited to 'vnfs/DAaaS/visualization/charts/grafana/templates/role.yaml')
-rwxr-xr-xvnfs/DAaaS/visualization/charts/grafana/templates/role.yaml31
1 files changed, 31 insertions, 0 deletions
diff --git a/vnfs/DAaaS/visualization/charts/grafana/templates/role.yaml b/vnfs/DAaaS/visualization/charts/grafana/templates/role.yaml
new file mode 100755
index 00000000..f6165694
--- /dev/null
+++ b/vnfs/DAaaS/visualization/charts/grafana/templates/role.yaml
@@ -0,0 +1,31 @@
+{{- if .Values.rbac.create -}}
+apiVersion: rbac.authorization.k8s.io/v1beta1
+kind: Role
+metadata:
+ name: {{ template "grafana.fullname" . }}
+ labels:
+ app: {{ template "grafana.name" . }}
+ chart: {{ .Chart.Name }}-{{ .Chart.Version }}
+ heritage: {{ .Release.Service }}
+ release: {{ .Release.Name }}
+{{- with .Values.annotations }}
+ annotations:
+{{ toYaml . | indent 4 }}
+{{- end }}
+{{- if or .Values.rbac.pspEnabled (and .Values.rbac.namespaced (or .Values.sidecar.dashboards.enabled .Values.sidecar.datasources.enabled)) }}
+rules:
+{{- if .Values.rbac.pspEnabled }}
+- apiGroups: ['extensions']
+ resources: ['podsecuritypolicies']
+ verbs: ['use']
+ resourceNames: [{{ template "grafana.fullname" . }}]
+{{- end }}
+{{- if and .Values.rbac.namespaced (or .Values.sidecar.dashboards.enabled .Values.sidecar.datasources.enabled) }}
+- apiGroups: [""] # "" indicates the core API group
+ resources: ["configmaps"]
+ verbs: ["get", "watch", "list"]
+{{- end }}
+{{- else }}
+rules: []
+{{- end }}
+{{- end }}