You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

21 lines
864 B

for i in `kubectl get pod -A | grep Evicted | cut -f1 -d' '|uniq`
do
kubectl get pod -n $i | grep Evicted | awk '{print $1}' | xargs kubectl delete pod -n $i
done
for i in `kubectl get pod -A | grep Completed | cut -f1 -d' '|uniq`
do
kubectl get pod -n $i | grep Completed | awk '{print $1}' | xargs kubectl delete pod -n $i
done
for i in `kubectl get pod -A | grep ContainerStatusUnknown | cut -f1 -d' '|uniq`
do
kubectl get pod -n $i | grep ContainerStatusUnknown | awk '{print $1}' | xargs kubectl delete pod -n $i
done
for i in `kubectl get pod -A | grep Error | cut -f1 -d' '|uniq`
do
kubectl get pod -n $i | grep Error | awk '{print $1}' | xargs kubectl delete pod -n $i
done
for i in `kubectl get pod -A | grep ImagePullBackOff | cut -f1 -d' '|uniq`
do
kubectl get pod -n $i | grep ImagePullBackOff | awk '{print $1}' | xargs kubectl delete pod -n $i
done