local-path-provisioner
local-path-provisioner copied to clipboard
Support ReadWriteOncePod access mode
Looks like the proper way to ensure single-pod access to volume is using a new ReadWriteOncePod access mode introduced here in Kubernetes 1.22
It would be nice to have this supported in local-path-provisioner
Now I'm getting this error:
The PersistentVolumeClaim "workdir-pvc-tmp" is invalid: spec.accessModes:
Unsupported value: "ReadWriteOncePod":
supported values: "ReadOnlyMany", "ReadWriteMany", "ReadWriteOnce"
+1, RWOP is graduating to Beta in v1.27 https://github.com/kubernetes/kubernetes/issues/103132.
Thanks for the request. Will check how to achieve it in the current design.
Thanks for adding support for this!
It looks like this line will need updating to also include a check for ReadWriteOncePod:
https://github.com/rancher/local-path-provisioner/blob/v0.0.23/provisioner.go#L239
See this blog post for more context on enabling this feature in k8s. This section contains more details on adding support for CSI drivers, but it looks like this project may not apply? https://kubernetes.io/blog/2021/09/13/read-write-once-pod-access-mode-alpha/#as-a-storage-vendor-how-do-i-add-support-for-this-access-mode-to-my-csi-driver
So long as you have the feature gate enabled in kube-apiserver, kube-scheduler, and kubelet, and use a version of this provisioner that supports the access mode it should work.