Reputation: 395
We have observed that GKE does not delete the Disks even after deleting the cluster which results into lots of Disks for the cluster which don't even exists.
In below link, It is mentioned that GKE will not delete persistent disks but what is the rational behind not deleting the disks.
https://cloud.google.com/kubernetes-engine/docs/how-to/deleting-a-cluster#overview
If we are deleting the cluster it means we don't need the resources associated with it so ideally it should delete disks too which would help in saving the storage cost too.
Upvotes: 0
Views: 969
Reputation: 3784
Persistent disks are located independently from your virtual machine (VM) instances, so you can detach or move persistent disks to keep your data even after you delete your instances. This is the reason Persistent disks will not delete when we delete the cluster and also in order to prevent your data from getting lost during sudden deletion of a cluster or under some unwanted cirucmstances.
If you want to delete the disk also permanently then this can be fixed by first deleting all the namespaces. When you delete a claim, the corresponding PersistentVolume object and the provisioned Compute Engine persistent disk are also deleted.
Refer to this SO1 and SO2, how to delete persistent volume disks.
Upvotes: 1