Is the storage size allocated to PVC fixed or dynamic? Can i request for more PVC’s than the actual PV size if the space is not utilized?
Not as far as I understand. I seem to recall Nigel saying that, if the claim is larger than the space available, the claim just sits there as pending.
The size of a volume is fixed at the time of the claim, which contains the size request under ‘resources:…requests: requests… storage:’ If you are using dynamic PVs then the PV created will match the storage request of the PVC. If you are not using dynamic PVs then the full volume defined in the PV (which much be at least as much as the claim) will be allocated. IOW, if your PV is 10G and your PVC is 5G you will get the full 10G allocated. There is a 1:1 relation between PVs & PVCs. This is why it’s important to use dynamic PVs whenever possible. It makes better use of storage available to the cluster.
Just to add some clarification…. You cannot have a single large PV with multiple smaller PVCs using it. E.g. you cannot have a 100GB PV with two 50GB PVCs sharing it.
I also struggled with all this, and found a great article explaining the concepts (and some of the history behind it), here: https://rancher.com/blog/2018/2018-09-20-unexpected-kubernetes-part-1/