0

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.

saurabh umathe
  • 315
  • 2
  • 17

1 Answers1

1

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.

Hemanth Kumar
  • 2,728
  • 1
  • 4
  • 19
  • Thanks @Hemanth, i was curious to know why disks are not deleted with the cluster, i think the scenarios where it's required may be less only. GKE ideally should show some kind of pop-up or notification saying "these are the disks attached to the cluster you are going to delete do you want to keep or delete them". That would help for timely cleanup and not to miss on deleting the disks right away. – saurabh umathe Dec 22 '22 at 15:09