RWO pvc to be accessed by two pods on one node

hi,

I have seen a couple of topics with this question and it says it can be possible but still not sure how. When I try to create a deployment with 3 pods (2 of them need access to one pod), the deployment fails because the third pod will try to mount to pvc but it is already mounted by the first pod. If it’s already mounted on the first pod how to use it on the third one?

RWO volume can be accessed by multiple pods those are in one node rather than in multiple nodes.

yeah, but still not sure how to implement that. the first pod will mount the volume but the other pod is failing because the volume is already mounted. Will try to use the same volume name of the first pod on the second pod on storage.

Ex:
on pod 1 and pod 2 use the same name for volume name and mount same folder:
volume:
name: volume1
persistentVolumeClaim:
claimName: pvc1

You can create a Longhorn PVC first.
Then, create multiple pods, with the nodeSelector to let the pods stay in the same node, mount the same Longhorn volume.

1 Like