2018-12-10 19:25:34 +00:00
|
|
|
{{- if .Values.rbac.create -}}
|
|
|
|
kind: ClusterRole
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
metadata:
|
|
|
|
name: {{ include "ceph-csi-rbd.provisioner.fullname" . }}
|
|
|
|
labels:
|
|
|
|
app: {{ include "ceph-csi-rbd.name" . }}
|
|
|
|
chart: {{ include "ceph-csi-rbd.chart" . }}
|
|
|
|
component: {{ .Values.provisioner.name }}
|
|
|
|
release: {{ .Release.Name }}
|
|
|
|
heritage: {{ .Release.Service }}
|
2022-10-14 14:59:09 +00:00
|
|
|
{{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }}
|
2020-08-12 15:25:36 +00:00
|
|
|
rules:
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["secrets"]
|
2021-01-24 14:17:33 +00:00
|
|
|
verbs: ["get", "list", "watch"]
|
2020-08-12 15:25:36 +00:00
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["persistentvolumes"]
|
|
|
|
verbs: ["get", "list", "watch", "create", "update", "delete", "patch"]
|
|
|
|
- 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"]
|
|
|
|
{{- if .Values.provisioner.attacher.enabled }}
|
|
|
|
- apiGroups: ["storage.k8s.io"]
|
|
|
|
resources: ["volumeattachments"]
|
|
|
|
verbs: ["get", "list", "watch", "update", "patch"]
|
2020-09-30 04:58:08 +00:00
|
|
|
- apiGroups: ["storage.k8s.io"]
|
|
|
|
resources: ["volumeattachments/status"]
|
|
|
|
verbs: ["patch"]
|
2020-08-12 15:25:36 +00:00
|
|
|
{{- end }}
|
2024-03-14 10:16:46 +00:00
|
|
|
{{- if .Values.provisioner.snapshotter.args.enableVolumeGroupSnapshots }}
|
2020-08-12 15:25:36 +00:00
|
|
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumesnapshots"]
|
2024-03-14 10:16:46 +00:00
|
|
|
verbs: ["get", "list", "watch", "update", "patch", "create"]
|
2022-01-17 12:58:38 +00:00
|
|
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
2024-03-14 10:16:46 +00:00
|
|
|
resources: ["volumesnapshotcontents"]
|
|
|
|
verbs: ["get", "list", "watch", "update", "patch", "create"]
|
|
|
|
- apiGroups: ["groupsnapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumegroupsnapshotclasses"]
|
|
|
|
verbs: ["get", "list", "watch"]
|
|
|
|
- apiGroups: ["groupsnapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumegroupsnapshotcontents"]
|
|
|
|
verbs: ["get", "list", "watch", "update", "patch"]
|
|
|
|
- apiGroups: ["groupsnapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumegroupsnapshotcontents/status"]
|
|
|
|
verbs: ["update", "patch"]
|
|
|
|
{{ else }}
|
|
|
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumesnapshots"]
|
2022-01-17 12:58:38 +00:00
|
|
|
verbs: ["get", "list", "patch"]
|
2020-08-12 15:25:36 +00:00
|
|
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumesnapshotcontents"]
|
2022-01-17 12:58:38 +00:00
|
|
|
verbs: ["create", "get", "list", "watch", "update", "delete", "patch"]
|
2024-03-14 10:16:46 +00:00
|
|
|
{{- end }}
|
|
|
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumesnapshots/status"]
|
|
|
|
verbs: ["get", "list", "patch"]
|
2020-08-12 15:25:36 +00:00
|
|
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumesnapshotclasses"]
|
|
|
|
verbs: ["get", "list", "watch"]
|
|
|
|
- apiGroups: ["snapshot.storage.k8s.io"]
|
|
|
|
resources: ["volumesnapshotcontents/status"]
|
2022-01-17 12:58:38 +00:00
|
|
|
verbs: ["update", "patch"]
|
2021-02-03 15:54:24 +00:00
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["configmaps"]
|
|
|
|
verbs: ["get"]
|
2021-06-24 10:39:40 +00:00
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["serviceaccounts"]
|
|
|
|
verbs: ["get"]
|
2020-08-12 15:25:36 +00:00
|
|
|
{{- if .Values.provisioner.resizer.enabled }}
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["persistentvolumeclaims/status"]
|
|
|
|
verbs: ["update", "patch"]
|
|
|
|
{{- end }}
|
2024-06-11 15:30:16 +00:00
|
|
|
{{- if .Values.topology.domainLabels }}
|
2020-08-12 15:25:36 +00:00
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["nodes"]
|
2021-08-12 08:23:42 +00:00
|
|
|
verbs: ["get", "list","watch"]
|
2020-08-12 15:25:36 +00:00
|
|
|
- apiGroups: ["storage.k8s.io"]
|
|
|
|
resources: ["csinodes"]
|
|
|
|
verbs: ["get", "list", "watch"]
|
|
|
|
{{- end }}
|
2022-06-08 14:11:36 +00:00
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["serviceaccounts/token"]
|
|
|
|
verbs: ["create"]
|
2020-08-12 15:25:36 +00:00
|
|
|
|
2018-12-10 19:25:34 +00:00
|
|
|
{{- end -}}
|