ozzyodys:
Hi all,
I would like to ask a point about PV-PVC relationship. In PV-PVC practice labs, we answer a question about size of the PVC that we created. In PVC YML file, we declare the the request of PVC size as “50Mi” but why then we’re seeing it’s capacity as “100Mi”? which it’s also PV’s size…
Maybe it’s because of there is only one PVC and all PV capacity allocated to it. OR, I’m missing something… Thx…
Priyanka Sharma:
The relationship between a PV and PVC is 1:1….only one PVC can be bound with one PV. If there are multiple PV’s available and a PVC comes in then kubernetes tries to bind the PVC with most appropriate PV as per the resource requirement….but if the only option is a PV with higher capacity then the requested storage then kubernetes binds the PVC to it and then the PVC claims the entire capacity of the allocated PV. Hope this helps!
Ramkumar Nagaraj:
also PV is cluster-scoped and PVC is namespaced scope. as mentioned in earlier thread pvc will identify the pv based on requirement. in this case only one PV is available as requirements met, it bound and used the whole PV size. Note: we cant share the pv space with multiple PVC
ozzyodys:
@Priyanka Sharma @Ramkumar Nagaraj thx a lot… Answers are very clear for me and PV-PVC relation fall into place now. I’m not sure if somehow I missed on the video but anyway, it’s nice to complete this missing part in my mind. have a great day!