Welcome to the Linux Foundation Forum!

How a PVC bound to a PV? lab 9.3

Options

We have
student@master:~$ vim pvc.yaml
student@master:~$ kubectl create -f pvc.yaml
persistentvolumeclaim/pvc-one created
student@master:~$ kubectl get pvc
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
pvc-one **Bound **pvvol-1 1Gi RWX 8s
student@master:~$ 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

  • chrispokorni
    chrispokorni Posts: 2,165
    Options

    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

  • zhangwe
    zhangwe Posts: 45
    Options

    Thanks.

Categories

Upcoming Training