I'm studying k8s and got a question about PV and PVC binding.
PVC defines the specs it wants (capacity, access mode etc..) in the YAML file and find appropriate PV in the cluster to bind each other.
Here, let's say our PVC wants at least 5GB capacity and RWO (ReadWriteOnce) mode.
And there are two PVs
- PV1: 5GB, RWO
- PV2: 10GB, RWO
which one would bind to the PVC? Both of them meets the spec of PVC.
Plus, what if we the pod fails and recreated?
If PV works as we want(in retain mode), I think the same PV should be bound to the PVC(pod) again to preserve the data. Does k8s guarantees this work?
If there's something ambiguous in my question, please let me know.
Thank you.