Longhorn persistent volume not support for multi pod bind


#1

Hi,

During deployment , using longhorn persistent volume with replica 2. but getting error while trying to mount pvc on pods. will Longhorn persistent volume support for multi pod bind with different worker nodes ?

Could please guide.

Thanks
Bala


#2

Hi @bala

Longhorn is a Read-Write-Once type storage for Kubernetes. It’s the same as AWS EBS and Google Persistent Disk, which can only be mounted on one node. It’s a distributed block storage solution rather than a distributed file system solution, so it cannot be written at the same time for the different nodes.

You can use StatefulSet with VolumeClaimTemplate instead of Deployment. Kubernetes would create a PVC per Pod, so that’s one Longhorn volume per Pod. In this way, you can scale your workload easily with Longhorn.


#3

Thank You much Yasker for explained.

Could please guide me the right persistent volume solution with Read write Many in Rancher Kubernetes


#4

You can take look at NFS.


#5

Any solution to implement block storage as pv ?


#6

Not sure what did you meant implement block storage a PV. Longhorn can be used as PV.

Though no block storage can support Read-Write-Many mode. It’s impossible since changing the storage content without filesystem knowing would result in data corruption.


#7

Thanks Sheng Yang. Got it.