#!/bin/bash for i in `seq 1 100` do kubectl delete pod $(kubectl get pod -n service |grep -i "evicted"|awk 'NR==1 {print $1}') -n service kubectl delete pod $(kubectl get pod -n test |grep -i "evicted"|awk 'NR==1 {print $1}') -n test done
多次执行后批量删除Evicted 状态的 Pods