Kubernetes Deep Dive

Sign Up Free or Log In to participate!

PV/PVC topic doubts

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?

4 Answers

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.

nigelpoulton

Correct.

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/

MS Panik

Anyone looking into this issue, take a moment to click the above link, it explains the issues and why we are where we are today.

Sign In
Welcome Back!

Psst…this one if you’ve been moved to ACG!

Get Started
Who’s going to be learning?