码迷,mamicode.com
首页 > 其他好文 > 详细

记一次批量删除Evicted状态的pod

时间:2020-03-28 16:25:47      阅读:352      评论:0      收藏:0      [点我收藏+]

标签:get   node   nod   tlb   res   删除   ali   eth   bbb   

由于node节点资源不足,造成资源的争抢,并出现大量的驱逐的pod,可以使用grep Evicted查看哪些pod

[root@k8s-master istio-1.4.2]# kubectl get pods -n istio-system | grep Evicted 
grafana-6b65874977-2w54r                  0/1     Evicted   0          21m
grafana-6b65874977-pcctb                  0/1     Evicted   0          21m
grafana-6b65874977-s6mkb                  0/1     Evicted   0          29m
istio-galley-5fc6d6c45b-tlbzs             0/1     Evicted   0          25m
istio-ingressgateway-6d759478d8-c8psq     0/1     Evicted   0          28m
istio-pilot-5c4995d687-5jtwd              0/1     Evicted   0          21m
istio-pilot-5c4995d687-678hg              0/1     Evicted   0          48m
istio-pilot-5c4995d687-bxt8p              0/1     Evicted   0          21m
istio-pilot-5c4995d687-c4zw8              0/1     Evicted   0          21m
istio-pilot-5c4995d687-cv79t              0/1     Evicted   0          21m
istio-pilot-5c4995d687-lwkf8              0/1     Evicted   0          21m
istio-pilot-5c4995d687-q4f5j              0/1     Evicted   0          21m
istio-pilot-5c4995d687-q77r2              0/1     Evicted   0          21m
istio-sidecar-injector-746f7c7bbb-9gv95   0/1     Evicted   0          51m
kiali-8559969566-pfh6t                    0/1     Evicted   0          51m
prometheus-66c5887c86-smcgv               0/1     Evicted   0          51m

针对这么istio-system命名空间下的pod,再找出Evicted的pod,执行delete

[root@k8s-master istio-1.4.2]# kubectl get pods -n istio-system | grep Evicted |awk ‘{print $1}‘ |xargs kubectl -n istio-system delete pod
pod "grafana-6b65874977-2w54r" deleted
pod "grafana-6b65874977-pcctb" deleted
pod "grafana-6b65874977-s6mkb" deleted
pod "istio-galley-5fc6d6c45b-tlbzs" deleted
pod "istio-ingressgateway-6d759478d8-c8psq" deleted
pod "istio-pilot-5c4995d687-5jtwd" deleted
pod "istio-pilot-5c4995d687-678hg" deleted
pod "istio-pilot-5c4995d687-bxt8p" deleted
pod "istio-pilot-5c4995d687-c4zw8" deleted
pod "istio-pilot-5c4995d687-cv79t" deleted
pod "istio-pilot-5c4995d687-lwkf8" deleted
pod "istio-pilot-5c4995d687-q4f5j" deleted
pod "istio-pilot-5c4995d687-q77r2" deleted
pod "istio-sidecar-injector-746f7c7bbb-9gv95" deleted
pod "kiali-8559969566-pfh6t" deleted
pod "prometheus-66c5887c86-smcgv" deleted

记一次批量删除Evicted状态的pod

标签:get   node   nod   tlb   res   删除   ali   eth   bbb   

原文地址:https://blog.51cto.com/14143894/2482669

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!