k8s namespace 清除方法
k8s 清除namespace 方法。
1: 看一下状态:
# kubectl get ns
NAME STATUS AGE
default Active 46h
kube-node-lease Active 46h
kube-public Active 46h
kube-system Active 46h
lucky Active 35h
splunk Active 24h
splunk-operator Terminating 24h
2: 生成json 文件:
kubectl get ns splunk-operator -o json > cattle.json
3: vi打开这个文件,删除finalizers下的kubernetes, 直接dd 删除后保存。
4: 手动创建会话,
kubectl proxy --port=8081
如果报错:
error: listen tcp 127.0.0.1:8081: bind: address already in use
5: 创建8082 port:
kubectl proxy --port=8082
6: 执行:
curl -k -H "Content-Type: application/json" -X PUT --data-binary @cattle.json http://127.0.0.1:8082/api/v1/namespaces/splunk-operator/finalize
7: 查看:
kubectl get ns
NAME STATUS AGE
default Active 46h
kube-node-lease Active 46h
kube-public Active 46h
kube-system Active 46h
lucky Active 35h
splunk Active 24h
更多推荐
所有评论(0)