diff --git a/deploy/charts/rook-ceph/templates/clusterrole.yaml b/deploy/charts/rook-ceph/templates/clusterrole.yaml index e5f970da0..e437a7f45 100644 --- a/deploy/charts/rook-ceph/templates/clusterrole.yaml +++ b/deploy/charts/rook-ceph/templates/clusterrole.yaml @@ -428,6 +428,21 @@ rules: resources: ["secrets"] verbs: ["get"] --- +# TODO: remove this, once https://github.com/rook/rook/issues/10141 +# is resolved. +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: ceph-nfs-csi-nodeplugin + labels: + operator: rook + storage-backend: ceph + {{- include "library.rook-ceph.labels" . | nindent 4 }} +rules: + - apiGroups: [""] + resources: ["nodes"] + verbs: ["get"] +--- {{ end }} kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 diff --git a/deploy/charts/rook-ceph/templates/clusterrolebinding.yaml b/deploy/charts/rook-ceph/templates/clusterrolebinding.yaml index eab75c715..2b409d0cc 100644 --- a/deploy/charts/rook-ceph/templates/clusterrolebinding.yaml +++ b/deploy/charts/rook-ceph/templates/clusterrolebinding.yaml @@ -101,6 +101,21 @@ roleRef: name: ceph-nfs-external-provisioner-runner apiGroup: rbac.authorization.k8s.io --- +# TODO: remove this, once https://github.com/rook/rook/issues/10141 +# is resolved. +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: ceph-nfs-csi-nodeplugin-role +subjects: + - kind: ServiceAccount + name: rook-csi-nfs-plugin-sa + namespace: {{ .Release.Namespace }} # namespace:operator +roleRef: + kind: ClusterRole + name: ceph-nfs-csi-nodeplugin + apiGroup: rbac.authorization.k8s.io +--- {{ end }} kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 diff --git a/deploy/examples/csi/nfs/rbac.yaml b/deploy/examples/csi/nfs/rbac.yaml index 8a98ae674..90e768f6e 100644 --- a/deploy/examples/csi/nfs/rbac.yaml +++ b/deploy/examples/csi/nfs/rbac.yaml @@ -2,6 +2,21 @@ # These RBAC resources are required to allow Rook to run the NFS export CSI driver components. #################################################################################################### --- +# TODO: remove this, once https://github.com/rook/rook/issues/10141 +# is resolved. +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: ceph-nfs-csi-nodeplugin + labels: + operator: rook + storage-backend: ceph + app.kubernetes.io/part-of: rook-ceph-operator +rules: + - apiGroups: [""] + resources: ["nodes"] + verbs: ["get"] +--- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1 metadata: @@ -32,6 +47,21 @@ rules: resources: ["secrets"] verbs: ["get"] --- +# TODO: remove this, once https://github.com/rook/rook/issues/10141 +# is resolved. +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: ceph-nfs-csi-nodeplugin-role +subjects: + - kind: ServiceAccount + name: rook-csi-nfs-plugin-sa + namespace: rook-ceph # namespace:operator +roleRef: + kind: ClusterRole + name: ceph-nfs-csi-nodeplugin + apiGroup: rbac.authorization.k8s.io +--- kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 metadata: diff --git a/deploy/olm/generate-rook-csv.sh b/deploy/olm/generate-rook-csv.sh index af219633d..a5293b481 100755 --- a/deploy/olm/generate-rook-csv.sh +++ b/deploy/olm/generate-rook-csv.sh @@ -191,6 +191,9 @@ function hack_csv() { $SED_IN_PLACE 's/cephfs-csi-nodeplugin/rook-csi-cephfs-plugin-sa/' "$CSV_FILE_NAME" $SED_IN_PLACE 's/cephfs-external-provisioner-runner/rook-csi-cephfs-provisioner-sa/' "$CSV_FILE_NAME" + $SED_IN_PLACE 's/ceph-nfs-csi-nodeplugin/rook-csi-nfs-plugin-sa/' "$CSV_FILE_NAME" + $SED_IN_PLACE 's/ceph-nfs-external-provisioner-runner/rook-csi-nfs-provisioner-sa/' "$CSV_FILE_NAME" + $SED_IN_PLACE 's/rbd-csi-nodeplugin/rook-csi-rbd-plugin-sa/' "$CSV_FILE_NAME" $SED_IN_PLACE 's/rbd-external-provisioner-runner/rook-csi-rbd-provisioner-sa/' "$CSV_FILE_NAME" # The operator-sdk also does not properly respect when