强制删除kubernetes的ns

问题背景

         部署istio测试环境,想重新部署istio-operator,在清理残留资源时,在使用 kubectl delete ns istio-operator --grace-period=0 --force删除istio-operator这个namespace时,发现这个ns一直卡在Terminating 状态。

解决

kubectl get ns istio-operator  -o json | jq 'del(.spec.finalizers)' |curl -v -H "Content-Type: application/json" -X PUT --data-binary @- http://127.0.0.1:8080/api/v1/namespaces/istio-operator/finalize

原文地址:https://www.cnblogs.com/360linux/p/13062049.html