k8s批量删除Evicted Pods
1、查询pod状态[root@k8s_master prom]# kubectl -n kube-system get pods | grep Evictedcoredns-67cb7b5f46-2crxg0/1Evicted04h56mcoredns-67cb7b5f46-2ds7n0/1 ...
·
1、查询pod状态
[root@k8s_master prom]# kubectl -n kube-system get pods | grep Evicted
coredns-67cb7b5f46-2crxg 0/1 Evicted 0 4h56m
coredns-67cb7b5f46-2ds7n 0/1 Evicted 0 4h56m
coredns-67cb7b5f46-2pzw5 0/1 Evicted 0 4h56m
coredns-67cb7b5f46-4f8nm 0/1 Evicted 0 166m
coredns-67cb7b5f46-4gncz 0/1 Evicted 0 10h
coredns-67cb7b5f46-4lnw2 0/1 Evicted 0 166m
coredns-67cb7b5f46-4smp6 0/1 Evicted 0 166m
coredns-67cb7b5f46-5hx49 0/1 Evicted 0 166m
coredns-67cb7b5f46-6jxqn 0/1 Evicted 0 166m
coredns-67cb7b5f46-6qh9z 0/1 Evicted 0 166m
coredns-67cb7b5f46-6rn4c 0/1 Evicted 0 10h
coredns-67cb7b5f46-7jsth 0/1 Evicted 0 10h
coredns-67cb7b5f46-7mzvb 0/1 Evicted 0 166m
coredns-67cb7b5f46-92t2k 0/1 Evicted 0 4h56m
coredns-67cb7b5f46-9jqdm 0/1 Evicted 0 10h
coredns-67cb7b5f46-9rxsc 0/1 Evicted 0 4h56m
coredns-67cb7b5f46-9xmkk 0/1 Evicted 0 166m
2、发现有很多 “Evicted” 状态的pod
问题原因:这是由于node节点的磁盘或内存资源不够后将现有的pod进行了驱赶。
3、批量删除kube-system下所有“Evicted”状态的pod即可
[root@k8s_master ]# kubectl -n kube-system get pods | grep Evicted |awk '{print$1}'|xargs kubectl -n kube-system delete pods
去掉-n kube-system是删除所有的pod
更多推荐
已为社区贡献10条内容
所有评论(0)