在这种情况下,kubedb运算符已崩溃且没有响应-但是我需要清理这些资源。
k delete redis r1 redis-queue --namespace cts --force --grace-period=0
warning: Immediate deletion does not wait for confirmation that the running resource has been terminated. The resource may continue to run on the cluster indefinitely.
Error from server (InternalError): Internal error occurred: failed calling webhook "redis.validators.kubedb.com": the server is currently unable to handle the request
Error from server (InternalError): Internal error occurred: failed calling webhook "redis.validators.kubedb.com": the server is currently unable to handle the request
最佳答案
应该有一种MutatingWebhookConfiguration
或ValidatingWebhookConfiguration
类型的资源,该资源实际上已在Kubernetes API Server中注册了webhook
。您需要首先删除该资源,该资源会从Kubernetes API服务器注销Webhook。
临时存储kubedb-webhook配置:
kubectl get ValidatingWebhookConfiguration redis.validators.kubedb.com \
-o yaml > redis-validator.yaml
kubectl get MutatingWebhookConfiguration redis.validators.kubedb.com \
-o yaml > redis-mutate-validator.yaml
删除资源:kubectl delete redis r1 redis-queue --namespace cts
调回webhook配置:kubectl apply -f redis-validator.yaml
kubectl apply -f redis-mutate-validator.yaml
关于kubernetes - 有没有办法通过失败的webhook强制删除crd?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/62392045/