Cmd:
kubectl get pods -A |grep ${podStatus} |awk '{printf("kubectl delete pods %s -n %s\n", $2,$1)}' | /bin/bash
Example:
kubectl get pods -A |grep UnexpectedAdmissionError |awk '{printf("kubectl delete pods %s -n %s\n", $2,$1)}' | /bin/bash
要删除成功的作业:
kubectl delete jobs --field-selector status.successful=1
删除失败或长时间运行的作业:
kubectl delete jobs --field-selector status.successful=0