How do I delete kubernetes resources on a local deploy?

6/28/2019

I am attempting to remove all resources from my local k8 deploy. I have tried individual deletes, bulk deletes, and delete all. I have deleted replica sets and deployments. No matter what I do, everything auto recreates itself instantly. How do I actually get rid of all this without having to hard reset k8?

-- MikeZ
docker
kubernetes

1 Answer

6/30/2019

Maybe there are some custom resources? Run a quick kubectl get crd to see if any CRDs are installed in your cluster. Try deleting them. When there's a controller listen for these CRDs it will re-create the resources instantly. In addition, you could run a kubectl get pods --all-namespaces and look, if you see any controller (mostly named something like <APPNAME>-controller-<SOMETHING> and delete them.

Another solution could be to delete the namespace (If your apps do not live in the default Namespace).

-- Alex
Source: StackOverflow