#!/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
标签:kubectl,grep,kubernetes,get,namespace,pod,evicted
From: https://www.cnblogs.com/wiseo/p/evicted_shell.html