016K8S批量命令操作集合
一、批量删除异常pod
#批量删除被驱逐的pod: kubectl get pods --all-namespaces | grep Evicted | awk '{print $1 " " $2}' | while read ns pod; do kubectl delete pod $pod -n $ns; done #批量删除错误的pod: kubectl get pods --all-namespaces | grep Error | awk '{print $1 " " $2}' | while read ns pod; do kubectl delete pod $pod -n $ns; done