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 ?
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.
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.
“You can use StatefulSet with VolumeClaimTemplate instead of Deployment. Kubernetes would create a PVC per Pod, so that’s one Longhorn volume per Pod.”
For Longhorn each volume, there is no relationship with others in Longhorn’s perspective. But the workload, a StatefulSet using these volumes for example, would write the same content to them.
You can create and access DigitalOcean Block Storage Volumes in a Kubernetes cluster by creating a PersistentVolumeClaim (PVC) as part of your deployment when you need to write and access persistent data. Using the Kubernetes command line tool, kubectl, this post will show you how to add volumes to your cluster.