现有问题: 删除namespace失败(强制删除也是出现报错),状态Terminating,如下:
[root@master ~]# kubectl delete ns cattle-impersonation-system --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 (Conflict): Operation cannot be fulfilled on namespaces "cattle-impersonation-system": The system is ensuring all content is removed from this namespace. Upon completion, this namespace will automatically be purged by the system.
解决方案,删除其中spec字段
1、创建代理服务器
kubectl proxy --port=8081
2、导出信息
kubectl get namespace cattle-impersonation-system -o json > txt.json
3、删除spec
4、curl 调用删除 ns
curl -k -H "Content-Type: application/json" -X PUT --data-binary @txt.json http://127.0.0.1:8081/api/v1/namespaces/cattle-impersonation-system/finalize