How to cleanup CRDs from a dead Operator deployment

Looking for a dashboard alternative to the Kubernetes dashboard, I stumbled upon Rancher.io. Raving reviews, open-source, and has good traction. Spun up a cluster and off to the races. Well from the title of this post, it did not go well and I had to uninstall it.

I installed it using helm and so I proceeded to do the same to uninstall it and it pretty much worked all except the Custom Resource Definitions. The CRDs created by Rancher.io was a lot and kubectl delete crd was not cutting it and I needed a way to iterate through the list of crds

Luckily for me, xargs was here to save the day in addition to using kubectl output

kubectl get customresourcedefinitions |grep cattle.io |awk '{print $1}' |xargs kubectl delete customresourcedefinitions

cattle.io was a common denominator for all the Rancher CRDs so this can vary depending on the Operator installed, you may use kong if you are trying to clean up kong CRDs for example.


Comments

Leave a Reply

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


Keep up, get in touch.

Follow

Instagram / Facebook

Designed with WordPress