2019-04-16 07:49:59 +00:00
|
|
|
{{- if .Values.rbac.create -}}
|
|
|
|
kind: ClusterRole
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
metadata:
|
|
|
|
name: {{ include "ceph-csi-rbd.provisioner.fullname" . }}-rules
|
|
|
|
labels:
|
|
|
|
app: {{ include "ceph-csi-rbd.name" . }}
|
|
|
|
chart: {{ include "ceph-csi-rbd.chart" . }}
|
|
|
|
component: {{ .Values.provisioner.name }}
|
|
|
|
release: {{ .Release.Name }}
|
|
|
|
heritage: {{ .Release.Service }}
|
|
|
|
rbac.rbd.csi.ceph.com/aggregate-to-{{ include "ceph-csi-rbd.provisioner.fullname" . }}: "true"
|
|
|
|
rules:
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["nodes"]
|
|
|
|
verbs: ["get", "list", "watch"]
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["secrets"]
|
|
|
|
verbs: ["get", "list"]
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["persistentvolumes"]
|
|
|
|
verbs: ["get", "list", "watch", "create", "update", "delete"]
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["persistentvolumeclaims"]
|
|
|
|
verbs: ["get", "list", "watch", "update"]
|
|
|
|
- apiGroups: ["storage.k8s.io"]
|
|
|
|
resources: ["storageclasses"]
|
|
|
|
verbs: ["get", "list", "watch"]
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["events"]
|
|
|
|
verbs: ["list", "watch", "create", "update", "patch"]
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["endpoints"]
|
|
|
|
verbs: ["get", "create", "update"]
|
|
|
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumesnapshots"]
|
|
|
|
verbs: ["get", "list", "watch", "update"]
|
2019-09-26 09:55:12 +00:00
|
|
|
{{- if .Values.provisioner.attacher.enabled }}
|
2019-04-16 07:49:59 +00:00
|
|
|
- apiGroups: ["storage.k8s.io"]
|
|
|
|
resources: ["volumeattachments"]
|
2019-09-26 09:55:12 +00:00
|
|
|
verbs: ["get", "list", "watch", "update", "patch"]
|
|
|
|
{{- end }}
|
2019-04-16 07:49:59 +00:00
|
|
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumesnapshotcontents"]
|
|
|
|
verbs: ["create", "get", "list", "watch", "update", "delete"]
|
|
|
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumesnapshotclasses"]
|
|
|
|
verbs: ["get", "list", "watch"]
|
|
|
|
- apiGroups: ["csi.storage.k8s.io"]
|
|
|
|
resources: ["csinodeinfos"]
|
|
|
|
verbs: ["get", "list", "watch"]
|
2019-09-26 09:55:12 +00:00
|
|
|
- apiGroups: ["apiextensions.k8s.io"]
|
|
|
|
resources: ["customresourcedefinitions"]
|
|
|
|
{{- if semverCompare ">=1.14" .Capabilities.KubeVersion.GitVersion }}
|
|
|
|
verbs: ["create", "list", "watch", "delete", "get", "update"]
|
|
|
|
{{- else }}
|
|
|
|
verbs: ["create"]
|
|
|
|
{{- end -}}
|
|
|
|
{{- if semverCompare ">=1.14" .Capabilities.KubeVersion.GitVersion }}
|
2019-07-25 06:49:44 +00:00
|
|
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumesnapshots/status"]
|
|
|
|
verbs: ["update"]
|
2019-04-16 07:49:59 +00:00
|
|
|
{{- end -}}
|
2019-09-26 09:55:12 +00:00
|
|
|
{{- end -}}
|