k8s中删除处于Terminating状态的namespace
将ns以json输出的内容保存到tmp.json文件中kubectl get namespace monitoring -o json > tmp.json删除finalizers 字段中的内容{"apiVersion": "v1","kind": "Namespace","metadata": {"annotations": {"kubectl.kubernetes.io/last-app
·
将ns以json输出的内容保存到tmp.json文件中
kubectl get namespace monitoring -o json > tmp.json
删除finalizers 字段中的内容
{ "apiVersion": "v1", "kind": "Namespace", "metadata": { "annotations": { "kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"annotations\":{},\"name\":\"monitoring\"}}\n" }, "creationTimestamp": "2022-05-09T07:31:54Z", "deletionTimestamp": "2022-05-09T10:53:16Z", "labels": { "kubernetes.io/metadata.name": "monitoring" }, "name": "monitoring", "resourceVersion": "793343", "uid": "a37548e2-1673-443b-b75e-01771c05310c" }, "spec": { "finalizers": [ "kubernetes" ##把这行删掉 ] }, "status": { "conditions": [ { "lastTransitionTime": "2022-05-09T11:17:28Z", "message": "All resou ..... .....
克隆新会话
kubectl proxy --port=8081
修改配置
curl -k -H "Content-Type: application/json" -X PUT --data-binary @tmp.json http://127.0.0.1:8081/api/v1/namespaces/monitoring/finalize
查看namespace
kubectl get ns
更多推荐
已为社区贡献3条内容
所有评论(0)