1. 程式人生 > >kubernetes清除狀態為Evicted的pod

kubernetes清除狀態為Evicted的pod

kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pod

  

清除指令碼

#!/bin/bash
for pod in $(kubectl get pods|grep Evicted|awk '{print $1}');
do
  kubectl delete pods $pod
done