Created
March 22, 2019 03:13
-
-
Save kasunbg/03d4617a5917ef764d49c104be39e7a4 to your computer and use it in GitHub Desktop.
Delete k8s namespaces that are more than one day old
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
#!/bin/bash | |
kubectl get namespaces | sort -n -k3 | grep "kubernetes-namespace.*d$" | awk '{print $1}' | xargs kubectl delete namespaces |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment