clusterrole.yaml 808 B

12345678910111213141516171819202122232425
  1. {{- if and .Values.rbac.create (not .Values.rbac.namespaced) }}
  2. kind: ClusterRole
  3. apiVersion: rbac.authorization.k8s.io/v1
  4. metadata:
  5. labels:
  6. {{- include "grafana.labels" . | nindent 4 }}
  7. {{- with .Values.annotations }}
  8. annotations:
  9. {{ toYaml . | indent 4 }}
  10. {{- end }}
  11. name: {{ template "grafana.fullname" . }}-clusterrole
  12. {{- if or .Values.sidecar.dashboards.enabled (or .Values.sidecar.datasources.enabled .Values.rbac.extraClusterRoleRules) }}
  13. rules:
  14. {{- if or .Values.sidecar.dashboards.enabled .Values.sidecar.datasources.enabled }}
  15. - apiGroups: [""] # "" indicates the core API group
  16. resources: ["configmaps", "secrets"]
  17. verbs: ["get", "watch", "list"]
  18. {{- end}}
  19. {{- with .Values.rbac.extraClusterRoleRules }}
  20. {{ toYaml . | indent 0 }}
  21. {{- end}}
  22. {{- else }}
  23. rules: []
  24. {{- end}}
  25. {{- end}}