Created
February 22, 2021 18:10
-
-
Save deevis/a8617e68903ca063ce94dec9c7557d41 to your computer and use it in GitHub Desktop.
Delete Kubectl namespaces in my project older than 40d ( but not > 99)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for ns in `kubectl get pods -A | grep my_project_name | grep "^.*[4-9]\dd$" | awk {'print $1'} | uniq`;do kubectl delete namespace $ns --namespace $ns; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment