1、获取要删除的资源
kubectl get po | grep Terminating
2、使用awk获取资源名称
kubectl get po | grep Terminating | awk '{print $1}'
3、批量删除资源(资源过滤命令使用符号``括起来)
kubectl delete po ` kubectl get po | grep Terminating | awk '{print $1}' `
kubectl get po | grep Terminating
kubectl get po | grep Terminating | awk '{print $1}'
kubectl delete po ` kubectl get po | grep Terminating | awk '{print $1}' `