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
————————————————————————
作者:乔克叔叔
版权声明:自由转载-非商用-非衍生-转载请注明出处!