首页 > 其他分享 >Namespoace Terminating 解决办法

Namespoace Terminating 解决办法

时间:2024-08-09 15:41:22浏览次数:11  
标签:解决办法 rocky01 kubectl prom Terminating Active Namespoace root

场景:当我们删除某个k8s 命名空间时候,有时候会半天删不掉,一直提示Terminating,下面介绍解决办法:

[root@rocky01 kubeasz] # kubectl delete ns prom
[root@rocky01 ~] # kubectl get ns | grep prom
prom              Terminating   6m7s
# ###
[root@rocky01 ~] # NS=prom   # 注意改为要删除的NS
[root@rocky01 ~] # kubectl get namespace $NS -o json | jq '.spec.finalizers = []' | kubectl replace --raw "/api/v1/namespaces/$NS/finalize" -f -
[root@rocky01 ~] # kubectl get ns
NAME              STATUS   AGE
argo-rollouts     Active   2d12h
argocd            Active   13h
default           Active   3d12h
ingress-nginx     Active   3d9h
kube-node-lease   Active   3d12h
kube-public       Active   3d12h
kube-system       Active   3d12h
lab               Active   2d18h
media             Active   36h

标签:解决办法,rocky01,kubectl,prom,Terminating,Active,Namespoace,root
From: https://www.cnblogs.com/Jas0n0ss/p/18350830

相关文章