Myluzh Blog

Strive to become a dream architect.

K8S 批量删除被驱逐的Pod(Evicted Pods)

2024-4-7 myluzh Kubernetes

0x01 故障 集群中一个deployment中有很多Evicted的pod root@iZbp12bkuvg20e1j3y9gtxZ:~# kubectl get pod -n base-ops NAME READY STATUS RESTARTS AGE registry-6d7b7c9fb4-22f2x 0/1 Evicted 0 10d registry-6d7b7c9fb4-24r7j 0/1 Evicted 0 10d registry-6d7b7c9fb4-25clg 0/1 Evicted 0 10d ... 0x02 原因 原因:由于node节点的磁盘或内存资源不够后将现有的pod进行了驱赶。可以把磁盘资源释放后,批量删除Evicted Pod kubectl -n base-ops  get pods | grep Evicted | awk '{print$1}' |xargs kubectl -n base-...

阅读全文>>

标签: k8s pod evicted 驱逐

评论(0) (121)