godo icon indicating copy to clipboard operation
godo copied to clipboard

Kubernetes.DeleteDangerous() does not delete PVC Volumes

Open regnaio opened this issue 1 year ago • 3 comments

According to the doctl kubernetes cluster delete docs, the --dangerous flag should delete PVC volumes

However, godo.Client.Kubernetes.DeleteDangerous() does not delete PVC Volumes

Using the latest version: v1.113.0

regnaio avatar Apr 23 '24 07:04 regnaio

Hey @regnaio, thanks for the report. I've reached out to our Kubernetes team for more details, and will report back when I hear back from them.

bentranter avatar Apr 23 '24 15:04 bentranter

hi @regnaio 👋 I work on the DOKS (managed Kubernetes) team at DO.

I just verified that the flag / godo function you mentioned is working as expected: a cluster which had a PVC got cleaned up properly, and the backing DO block storage volume was gone at the end when --dangerous was specified.

In case you were expecting to find code in godo that explicitly looks for PVCs/PVs in your cluster to delete them: that is actually not how the functionality is implemented. Instead, our backend keeps track of all managed resources and makes sure they get deleted when a cluster is (dangerously) deleted. I'm not sure if interactions against the API server is what you were referring when you quoted the godo function, but I figured I should add clarity here.

In case you do find that your cluster(s) aren't getting their volumes cleaned up when using the flag in question, could I ask you to file a DO support ticket? As mentioned the functionality seems to be working correctly per se, so any remaining issues may require taking a deeper look. Our support team is happy to help you on that should it be needed.

Thanks in advance!

timoreimann avatar Apr 23 '24 17:04 timoreimann

I can try this again the next time I spin up a DigitalOcean k8s cluster

However, I know for sure that I had XFS PVC's bound to Pods in the cluster (immediately before cluster deletion), so they should have been considered part of the cluster. godo.Client.Kubernetes.DeleteDangerous() did not delete the XFS PVC's

regnaio avatar Apr 25 '24 04:04 regnaio