apiVersion: v1 kind: ServiceAccount metadata: name: lvp namespace: lvp --- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: name: lvp-runner rules: - apiGroups: [""] resources: ["persistentvolumes"] verbs: ["get", "list", "watch", "patch", "create", "delete"] - apiGroups: [""] resources: ["persistentvolumeclaims"] verbs: ["get", "list", "watch", "update"] - apiGroups: [""] resources: ["persistentvolumeclaims/status"] verbs: ["patch"] - apiGroups: [""] resources: ["pods"] verbs: ["get", "list", "watch"] - apiGroups: ["storage.k8s.io"] resources: ["storageclasses"] verbs: ["get", "list", "watch"] - apiGroups: [""] resources: ["events"] verbs: ["list", "watch", "create", "update", "patch"] - apiGroups: ["snapshot.storage.k8s.io"] resources: ["volumesnapshots"] verbs: ["get", "list"] - apiGroups: ["snapshot.storage.k8s.io"] resources: ["volumesnapshotcontents"] verbs: ["get", "list"] - apiGroups: ["storage.k8s.io"] resources: ["csinodes"] verbs: ["get", "list", "watch"] - apiGroups: [""] resources: ["nodes"] verbs: ["get", "list", "watch"] - apiGroups: ["storage.k8s.io"] resources: ["volumeattachments"] verbs: ["get", "list", "watch", "patch"] - apiGroups: ["storage.k8s.io"] resources: ["volumeattachments/status"] verbs: ["patch"] # (Alpha) Access to referencegrants is only needed when the CSI driver # has the CrossNamespaceVolumeDataSource controller capability. # In that case, external-provisioner requires "get", "list", "watch" # permissions for "referencegrants" on "gateway.networking.k8s.io". #- apiGroups: ["gateway.networking.k8s.io"] # resources: ["referencegrants"] # verbs: ["get", "list", "watch"] --- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: name: lvp-role subjects: - kind: ServiceAccount name: lvp namespace: lvp roleRef: kind: ClusterRole name: lvp-runner apiGroup: rbac.authorization.k8s.io