美文网首页
删除k8s集群中所有Evicted状态的Pod

删除k8s集群中所有Evicted状态的Pod

作者: baiyongjie | 来源:发表于2022-06-28 10:30 被阅读0次

以下两条命令 直接复制执行即可

kubectl get pods -A |grep Evicted |awk '{print "kubectl delete pods -n " $1,$2}' | bash
for i in `kubectl get pods -A | grep Evicted | awk '{print $1}' |uniq`;do for j in `kubectl get pods -n $i |grep Evicted|awk '{print $1}'`; do kubectl delete pods -n $i $j; done; done

相关文章

网友评论

      本文标题:删除k8s集群中所有Evicted状态的Pod

      本文链接:https://www.haomeiwen.com/subject/wfyavrtx.html