Skip to content

Instantly share code, notes, and snippets.

@techlunacy
Created January 4, 2021 02:40
Show Gist options
  • Select an option

  • Save techlunacy/27944d7e4665ff427ff8ed80769942ab to your computer and use it in GitHub Desktop.

Select an option

Save techlunacy/27944d7e4665ff427ff8ed80769942ab to your computer and use it in GitHub Desktop.
delete all pods across namespaces borrowed heavily from https://gist.github.com/psxvoid/71492191b7cb06260036c90ab30cc9a0
kubectl get pods --all-namespaces | grep Error | awk '{print $2 " --namespace=" $1}' | xargs -I '{}' bash -c 'kubectl delete pods {}'
kubectl get pods --all-namespaces | grep OOMKilled | awk '{print $2 " --namespace=" $1}' | xargs -I '{}' bash -c 'kubectl delete pods {}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment