Namespoace Terminating 解决办法
场景:当我们删除某个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
本文来自博客园,作者:Jas0n0ss,转载请注明原文链接:https://www.cnblogs.com/Jas0n0ss/p/18350830