删除namespaces一直提示Terminating
发布时间:2019-11-23 22:12:41   来源:东方头条   评论 参与

问题描述$ kubectl get namespaces

NAME STATUS AGE

cephfs Active 147d

default Active 154d

kube-node-lease Active 62d

kube-public Active 154d

kube-system Active 154d

monitoring Terminating 7d20h

$ kubectl delete namespaces monitoring --grace-period=0 --force

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 "monitoring": The system is ensuring all content is removed from this namespace. Upon completion, this namespace will automatically be purged by the system.

解决办法$ kubectl get namespaces monitoring -o json > tmp.json

$ vim tmp.json

{

"apiVersion": "v1",

"kind": "Namespace",

"metadata": {

"annotations": {

"kubectl.kubernetes.io/last-applied-configuration": "{\"apiVersion\":\"v1\",\"kind\":\"Namespace\",\"metadata\":{\"annotations\":{},\"name\":\"monitoring\"}}\n"

},

"creationTimestamp": "2019-10-31T09:09:27Z",

"deletionTimestamp": "2019-11-08T03:19:50Z",

"name": "monitoring",

"resourceVersion": "26367884",

"selfLink": "/api/v1/namespaces/monitoring",

"uid": "23c34de1-fbbe-11e9-adc9-005056a85a7c"

},

"spec": {

"finalizers": [

....//删除这里的内容

]

},

"status": {

"phase": "Terminating"

}

}

$ kubectl proxy --port=8081

Starting to serve on 127.0.0.1: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

$ kubectl get namespaces

NAME STATUS AGE

cephfs Active 147d

default Active 154d

kube-node-lease Active 62d

kube-public Active 154d

kube-system Active 154d

① 康复在线网所有原创文章(含图片),未经允许不得转载或镜像;授权转载应在范围内使用,并注明来源。
② 部分内容转载自其他媒体,转载目的在于传递更多信息,并不代表本网赞同其观点和对其真实性负责。
③ 如因作品内容、版权和其他问题需要同本网联系:2816822384@qq.com,请在30日内进行。

相关热词搜索:删除 提示 namespaces Terminating

上一篇:华为Mate X卖疯了,黄牛炒到10万,换屏幕7080元
下一篇:最后一页

主办单位:《康复在线网》出版公司。 网站低俗信息举报信箱
康复在线网:立足“华人的角度”
违法和不良信息举报中心