Kubernetes deployment with 0 replicas and PVC

Posted November 28, 2020 679 views
DeploymentBlock StorageStorageKubernetes

I’m trying to decide if node PVC attach limits are going to affect me and I can’t find any official documentation on this…

I wish to deploy many instances of a deployment. Each deployment has a single PVC with dedicated storage. Often, these deployments will be scaled to zero replicas (to save money). At these times, the deployments still have associated PVC and when the replicas scale up again, the PVC is still there like I would expect.

I know that DO limits each node to 7 attached PVCs at a time. This is fine, my deployments won’t be able to fit more than 7 replicas per node, so all is good.

However, I’m concerned that a deployment with 0 replicas, which still has a PVC might be counted against this limit. So, finally, to my question.

When a deployment, with PVC, is scaled to 0 replicas, do the PVCs remain attached to a node and if so do they count against the limit of PVCs for that node?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Submit an Answer
1 answer

I’ll answer my own question. I’ve scaled my deployment replicas to 0 and I can see in my console that the volume which backs the PVC is un-attached. Thus the PVCs aren’t attached to a node and can’t count against node limits.

That’s kind of what I expected but wanted to make sure.