Skip to content

Instantly share code, notes, and snippets.

View vvolodin's full-sized avatar

Volodymyr Volodin vvolodin

View GitHub Profile
Spy Game, 2001
The Good Shepherd (2006)
The Ghost Writer, 2010
The Spy Who Came in from the Cold (1965)
Ronin (1998)
Tinker Tailor Soldier Spy (2011)
The American (2010)
@vvolodin
vvolodin / delete-evicted-pods-all-namespaces.sh
Created March 26, 2019 17:10 — forked from psxvoid/delete-evicted-pods-all-namespaces.sh
Delete evicted pods from all namespaces (also ImagePullBackOff and ErrImagePull)
#!/bin/sh
# based on https://gist.github.com/ipedrazas/9c622404fb41f2343a0db85b3821275d
# delete all evicted pods from all namespaces
kubectl get pods --all-namespaces | grep Evicted | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff state from all namespaces
kubectl get pods --all-namespaces | grep 'ImagePullBackOff' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod
# delete all containers in ImagePullBackOff or ErrImagePull or Evicted state from all namespaces