码迷,mamicode.com
首页 > 其他好文 > 详细

记录一次namespace 处于Terminating状态的处理方法

时间:2020-01-09 18:36:52      阅读:319      评论:0      收藏:0      [点我收藏+]

标签:pre   ttl   data   一个   logging   stat   ORC   confirm   remove   

现象:

[root@master kube-prometheus]# kubectl get namespaces -o wide
NAME                STATUS        AGE
cattle-logging      Active        174m
cattle-prometheus   Active        12h
cattle-system       Active        15h
default             Active        8d
kube-node-lease     Active        8d
kube-public         Active        8d
kube-system         Active        8d
monitoring          Terminating   11m

解决:

[root@master kube-prometheus]# kubectl delete namespace monitoring  --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 "monitoring": The system is ensuring all content is removed from this namespace.  Upon completion, this namespace will automatically be purged by the system.
[root@master kube-prometheus]# NAMESPACE=monitoring
[root@master kube-prometheus]# kubectl proxy &
[1] 973
[root@master kube-prometheus]# Starting to serve on 127.0.0.1:8001

新开一个链接:

[root@master helm]# kubectl get namespace $NAMESPACE -o json |jq ‘.spec = {"finalizers":[]}‘ >temp.json
[root@master helm]# curl -k -H "Content-Type: application/json" -X PUT --data-binary @temp.json 127.0.0.1:8001/api/v1/namespaces/$NAMESPACE/finalize
[root@master helm]# kubectl get ns
NAME                STATUS   AGE
cattle-logging      Active   178m
cattle-prometheus   Active   12h
cattle-system       Active   15h
default             Active   8d
kube-node-lease     Active   8d
kube-public         Active   8d
kube-system         Active   8d
[root@master helm]# kubectl get ns
NAME                STATUS   AGE
cattle-logging      Active   178m
cattle-prometheus   Active   12h
cattle-system       Active   15h
default             Active   8d
kube-node-lease     Active   8d
kube-public         Active   8d
kube-system         Active   8d

发现已经解决了

记录一次namespace 处于Terminating状态的处理方法

标签:pre   ttl   data   一个   logging   stat   ORC   confirm   remove   

原文地址:https://www.cnblogs.com/dalianpai/p/12172774.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!