Loading

kubernetes批量删除evicted状态pod

#!/bin/bash

# get namespace
namespaces=`kubectl get pod -A | grep -i "evicted" | awk '{print $1}'`
for namespace in ${namespaces}
do
    kubectl get pod -n ${namespace} |grep -i "evicted"|awk '{print $1}' | xargs kubectl delete pod -n ${namespace}
done
posted @ 2023-10-23 14:10  亚里士多智  阅读(269)  评论(0编辑  收藏  举报