k8s 强制删除pod kubectl -n kube-system delete pod traefik-ingress --force --grace-period=0
kubectl -n kube-system delete pod traefik-ingress-lb-bc45b7649-rvgxd --force --grace-period=0
kubectl get pod|awk -F'[ ]+' '$3~/Terminating/{print $1}'|xargs -n1 kubectl delete pod --force --grace-period=0
kubectl get pod|awk -F'[ ]+' '$3~/Terminating|Evicted/{print $1}'|xargs -n1 kubectl delete pod --force --grace-period=0
删除所有命名空间中pod状态不正常的pod
for i in `kubectl get ns|awk -F'[ ]+' 'NR>=2{print $1}'`;do kubectl get pod -n $i|awk -F'[ ]+' '$3~/Terminating|Evicted|OutOfcpu/{print $1}'|xargs -n1 kubectl delete pod --force --grace-period=0 -n $i;done
https://v1-16.docs.kubernetes.io/docs/reference/generated/kubernetes-api/v1.16/
时来天地皆同力,运去英雄不自由