Welcome to the Linux Foundation Forum!

How a PVC bound to a PV? lab 9.3

We have
[email protected]:~$ vim pvc.yaml
[email protected]:~$ kubectl create -f pvc.yaml
persistentvolumeclaim/pvc-one created
[email protected]:~$ kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
pvc-one **Bound **pvvol-1 1Gi RWX 8s
[email protected]:~$ kubectl get pv
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
pvvol-1 1Gi RWX Retain Bound default/pvc-one 8m1s

The pvc.yaml doesn't say anything about PV "pvvol-1", how does the "pvc-one" to bound to "pvvol-1"?
If there are two PVs "pvvol-1" and "pvvol-2" available, what will happen?

Answers

  • chrispokornichrispokorni Posts: 549

    Hi @zhangwe,

    On the "Persistent Volumes and Claims" page you can find an explanation of the "Bind" phase of the Persistent Storage.

    The description of the Bind phase from the official documentation may also help.

    The configuration properties of the PVC are used to find a PV with matching properties in order for the binding to occur. With multiple PVs available, the binding is random unless labels are specified.

    Regards,
    -Chris

  • zhangwezhangwe Posts: 39

    Thanks.

Sign In or Register to comment.