From 4b81ed080021095a87427863f9166397f1e6bcbe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torma=20Krist=C3=B3f?= Date: Fri, 26 Apr 2019 19:51:52 +0200 Subject: [PATCH] Update delete_evicted.sh --- delete_evicted.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/delete_evicted.sh b/delete_evicted.sh index 28a885a..4449816 100644 --- a/delete_evicted.sh +++ b/delete_evicted.sh @@ -1,5 +1,3 @@ #!/bin/bash -for each in $(kubectl get pods|grep Evicted|awk '{print $1}'); -do - kubectl delete pods $each -done + +kubectl get po --all-namespaces | awk '{if ($4 ~ /Evicted/) system ("kubectl -n " $1 " delete pods " $2)}'