Skip to content

Not able to completely remove Kubernetes CustomResource using kubectl delete crd – How to fix?

When you try to delete a crd using kubectl but it might hang for a long time without any response.

$ kubectl delete crd challenges.acme.cert-manager.io
customresourcedefinition.apiextensions.k8s.io "challenges.acme.cert-manager.io" deleted

This is because Custom resources with finalizers can cause a “deadlock”. To fix this we need to patch the resource and remove the finalizers.

Advertisements
$ kubectl delete crd challenges.acme.cert-manager.io
customresourcedefinition.apiextensions.k8s.io "challenges.acme.cert-manager.io" deleted

Now you can just go ahead and delete the crd.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.