Welcome to the Linux Foundation Forum!

Exercise: 3.2.19 how pvc knows about pv

Hello all,

I’m following the lfd259 and have a question regarding the exercise 3.2.19

There I’m creating the the generated svc, pvc and deployment from the yaml file and some steps before 3.2.11 I created the the volumes (pv)
Where is the connection between pvc and pv, how kubernetes knows that those pvc’s should be bound to the already created pv’s in the previous step (3.2.11)?

I would expect to have some kind of selector or name reference, but I don’t find anything

Thank you very much for your help

Best regards
Joao Martins

Comments

  • chrispokorni
    chrispokorni Posts: 2,605

    Hi Joao,

    By default, the PVCs are searching for PVs based on the properties included in the PVC yaml manifest. Once a PVC finds a PV that matches its properties, the PVC binds itself to the PV. When there are multiple PVs with matching properties, then the PVC binds itself randomly to one of the PVs.

    In multi-PV and multi-PVC scenarios, we may use labels and selectors to ensure that PVC1 binds to PV1, and PVC2 binds to PV2... Otherwise, the bind is random.

    Regards,
    -Chris

Categories

Upcoming Training