Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RBAC for CSI NFS attacher does not provide needed access for resource "volumeattachments/status" #336

Open
aavarghese opened this issue Mar 6, 2024 · 1 comment
Labels
bug Something isn't working nfs Issues relating to NFS support in Datashim

Comments

@aavarghese
Copy link

Error below seen in pod csi-attacher-nfsplugin-0 when creating an NFS Dataset.

I0306 20:50:18.008574       1 round_trippers.go:435] curl -v -XPATCH  -H "Content-Type: application/merge-patch+json" -H "User-Agent: csi-attacher/v0.0.0 (linux/amd64) kubernetes/$Format" -H "Accept: application/json, */*" -H "Authorization: Bearer <masked>" 'https://10.96.0.1:443/apis/storage.k8s.io/v1/volumeattachments/csi-7e6c50e417c19067c5a2c953bcb7463aece946ea95e18b644650ba9d7807b63c/status'
I0306 20:50:18.010396       1 round_trippers.go:454] PATCH https://10.96.0.1:443/apis/storage.k8s.io/v1/volumeattachments/csi-7e6c50e417c19067c5a2c953bcb7463aece946ea95e18b644650ba9d7807b63c/status 403 Forbidden in 1 milliseconds
I0306 20:50:18.010468       1 request.go:1181] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"volumeattachments.storage.k8s.io \"csi-7e6c50e417c19067c5a2c953bcb7463aece946ea95e18b644650ba9d7807b63c\" is forbidden: User \"system:serviceaccount:jaas-system-avarghese:csi-attacher-nfs\" cannot patch resource \"volumeattachments/status\" in API group \"storage.k8s.io\" at the cluster scope","reason":"Forbidden","details":{"name":"csi-7e6c50e417c19067c5a2c953bcb7463aece946ea95e18b644650ba9d7807b63c","group":"storage.k8s.io","kind":"volumeattachments"},"code":403}
W0306 20:50:18.010555       1 trivial_handler.go:57] Error saving VolumeAttachment csi-7e6c50e417c19067c5a2c953bcb7463aece946ea95e18b644650ba9d7807b63c as attached: volumeattachments.storage.k8s.io "csi-7e6c50e417c19067c5a2c953bcb7463aece946ea95e18b644650ba9d7807b63c" is forbidden: User "system:serviceaccount:jaas-system-avarghese:csi-attacher-nfs" cannot patch resource "volumeattachments/status" in API group "storage.k8s.io" at the cluster scope

Fix: Needs resource "volumeattachments/status" added to

- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update", "patch"]

/cc @srikumar003 @starpit

@srikumar003
Copy link
Collaborator

Thanks @aavarghese! We'll have a PR to address it

@srikumar003 srikumar003 added bug Something isn't working nfs Issues relating to NFS support in Datashim labels Mar 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working nfs Issues relating to NFS support in Datashim
Projects
None yet
Development

No branches or pull requests

2 participants