1.删除namespace的时候一直卡住,查看ns状态显示为Terminating
[root@master elk]# kubectl get namespace
NAME STATUS AGE
default Active 26h
elastic-system Terminating 13h
ingress-nginx Active 26h
kube-logging Terminating 6h1m
kube-node-lease Active 26h
kube-public Active 26h
kube-system Active 26h
kubernetes-dashboard Active 26h
2.导出namespace信息
kubectl get namespace elastic-system -o json > /tmp/txt.json
3.修改/tmp/txt.json文件
"spec": {
"finalizers": [
"kubernetes"
]
修改为
"spec": {
"finalizers": [
]
4.进入proxy模式
kubectl proxy --port=8081
5.curl调用删除namespace
cd /tmp
curl -k -H "Content-Type: application/json" -X PUT --data-binary @txt.json http://127.0.0.1:8081/api/v1/namespaces/elastic-system/finalize
6.再次查看
[root@master ~]#kubectl get ns
NAME STATUS AGE
default Active 26h
ingress-nginx Active 26h
kube-logging Terminating 6h8m
kube-node-lease Active 26h
kube-public Active 26h
kube-system Active 26h
kubernetes-dashboard Active 26h
版权声明:本文为博主原创文章,未经博主允许不得转载。
k8s