1、使用命令獲取pod的名字
kubectl get po -n NAMESPACE |grep Terminating
2、使用kubectl中的強制刪除命令
kubectl delete pod podName -n NAMESPACE --force --grace-period=0
- 批量刪除處于Terminating的容器
kubectl get pods -n default | grep Terminating | awk '{print $1}' | xargs kubectl delete pod -n default --force --grace-period=0