2023-04-14 10:44:57 +00:00
{{- if and .Values.rbac.create (or (not .Values.rbac.namespaced) .Values.rbac.extraClusterRoleRules) (not .Values.rbac.useExistingRole) }}
2020-12-18 00:46:15 +00:00
kind : ClusterRole
apiVersion : rbac.authorization.k8s.io/v1
metadata :
labels :
{{- include "grafana.labels" . | nindent 4 }}
2022-12-06 20:43:11 +00:00
{{- with .Values.annotations }}
2020-12-18 00:46:15 +00:00
annotations :
2022-12-06 20:43:11 +00:00
{{- toYaml . | nindent 4 }}
{{- end }}
name : {{ include "grafana.fullname" . }}-clusterrole
2023-05-13 08:38:33 +00:00
{{- if or .Values.sidecar.dashboards.enabled .Values.rbac.extraClusterRoleRules .Values.sidecar.datasources.enabled .Values.sidecar.plugins.enabled .Values.sidecar.alerts.enabled }}
2020-12-18 00:46:15 +00:00
rules :
2023-05-13 08:38:33 +00:00
{{- if or .Values.sidecar.dashboards.enabled .Values.sidecar.datasources.enabled .Values.sidecar.plugins.enabled .Values.sidecar.alerts.enabled }}
2022-12-06 20:43:11 +00:00
- apiGroups : [ "" ] # "" indicates the core API group
resources : [ "configmaps" , "secrets" ]
verbs : [ "get" , "watch" , "list" ]
{{- end}}
{{- with .Values.rbac.extraClusterRoleRules }}
{{- toYaml . | nindent 2 }}
{{- end}}
2020-12-18 00:46:15 +00:00
{{- else }}
rules : [ ]
{{- end}}
{{- end}}