Skip to content

Instantly share code, notes, and snippets.

@marfenij
Last active May 19, 2020 10:31
Show Gist options
  • Save marfenij/c8fcd35e792ccf2e29fdd0140b5be133 to your computer and use it in GitHub Desktop.
Save marfenij/c8fcd35e792ccf2e29fdd0140b5be133 to your computer and use it in GitHub Desktop.
remove old stuff
# get inactive rs
kubectl get rs | awk '{if ($2=="0") print $0}'
# delete inactive rs
kubectl get rs | awk '{if ($2=="0") print $1}' | xargs kubectl delete rs
# get error job
kubectl get job | awk '{if ($2=="0/1") print $0}'
# delete error job
kubectl get job | awk '{if ($2=="0/1") print $1}' | xargs kubectl delete job
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment