How to shrink persistent disk size?

Hello,

I'm using a `statefulset` on GKE, I overestimated the size of the storage nodes and ended up trying to reduce the SSD persistent disks size. 
I'm aware that Kubernetes does not support shrinking volumes.
I still need to do it, so I'm thinking about resizing manually the pv & pvc and then resize the actual GCP persistent disk (at least via snapshot).

I can't find any useful material on that part though.

Any help please? 🙏 
 

Solved Solved
2 2 4,325
1 ACCEPTED SOLUTION

Hello,

You may find that your attempt at changing the size of the PV, PVC and the persistent disk will result in many more errors that you will have to deal with. I would suggest copying what you need and then moving it to another disk that is your desired size. This would follow the idea that resources are more like cattle rather than pets in Kubernetes. Restarting the system over is easier than trying to fix an existing system is the point I am trying to make.

 

View solution in original post

2 REPLIES 2

Hello,

You may find that your attempt at changing the size of the PV, PVC and the persistent disk will result in many more errors that you will have to deal with. I would suggest copying what you need and then moving it to another disk that is your desired size. This would follow the idea that resources are more like cattle rather than pets in Kubernetes. Restarting the system over is easier than trying to fix an existing system is the point I am trying to make.

 

That's what I ended up doing, thanks!