Is there a way to force delete a crd with failing webhooks? Is there a way to force delete a crd with failing webhooks? kubernetes kubernetes

Is there a way to force delete a crd with failing webhooks?


There should be a resource of kind MutatingWebhookConfiguration or ValidatingWebhookConfiguration which actually registers the webhook with Kubernetes API Server. You need to delete that resource first which deregisters the webhook from the Kubernetes API Server.

Temporary store kubedb-webhook configuration:

kubectl get ValidatingWebhookConfiguration redis.validators.kubedb.com \  -o yaml > redis-validator.yamlkubectl get MutatingWebhookConfiguration redis.validators.kubedb.com \  -o yaml > redis-mutate-validator.yaml

Remove your resources:

kubectl delete redis r1 redis-queue --namespace cts

Bring back the webhook configuration:

kubectl apply -f redis-validator.yamlkubectl apply -f redis-mutate-validator.yaml