Can a PVC be Bound to Multiple PVs or Vice-Versa in Kubernetes?
The short answer is NO.
As mentioned in the documentation, PersistentVolumeClaims (PVC) and PersistentVolumes (PV) in K8S have a one-to-one relationship:
A PVC to PV binding is a one-to-one mapping, using a ClaimRef which is a bi-directional binding between the PersistentVolume and the PersistentVolumeClaim.
When a PVC is using a PV, its spec.volumeName
points to the PV name:
$ k get pvc
NAME STATUS VOLUME CAPACITY
myclaim-2 Bound pvc-f13e3b19-a025-4939-82b8-7f0e8ac11dd5 15Gi
$ k get pvc myclaim-2 -o yaml | grep volumeName
volumeName: pvc-f13e3b19-a025-4939-82b8-7f0e8ac11dd5
On the other hand, the PV’s spec.claimRef
points to the PVC making it a one-to-one relationship:
$ k get pv pvc-f13e3b19-a025-4939-82b8-7f0e8ac11dd5 -o yaml | grep claimRef -A 5
claimRef:
apiVersion: v1
kind: PersistentVolumeClaim
name: myclaim-2
namespace: test
resourceVersion: "589626544"
A PV in Kubernetes is an “atomic” abstraction that cannot be “divided” further amongst multiple PVCs. A PVC is exclusive to a PV and vice-versa. However, do note that multiple PVs can be created that point to the same storage asset or backing medium (like an AWS or a GCP disk). Whether you can use these PVs (pointing to the same disk) via PVCs in multiple pods/nodes depends upon the access mode of the PV/PVC.
So each PVC and PV pair represents a unique volume in Kubernetes’ abstract storage system but multiple pairs could be backed by the same disk (in your cloud provider for instance).