local-path-provisioner icon indicating copy to clipboard operation
local-path-provisioner copied to clipboard

Support ReadWriteOncePod access mode

Open kskalski opened this issue 2 years ago • 3 comments

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"

kskalski avatar Nov 26 '22 08:11 kskalski

+1, RWOP is graduating to Beta in v1.27 https://github.com/kubernetes/kubernetes/issues/103132.

kerthcet avatar Nov 30 '22 09:11 kerthcet

Thanks for the request. Will check how to achieve it in the current design.

derekbit avatar Dec 12 '22 02:12 derekbit

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.

chrishenzie avatar Jan 30 '23 23:01 chrishenzie