由于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