Last active
March 24, 2022 00:59
-
-
Save greenygh0st/579dbe591193a416ac8f484268235751 to your computer and use it in GitHub Desktop.
Removed bad and failed Kubernetes pods
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
# all | |
kubectl get pods --all-namespaces | grep -E 'ImagePullBackOff|ErrImagePull|Evicted|Terminating' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod --grace-period=0 --force | |
# not terminated | |
kubectl get pods --all-namespaces | grep -E 'ImagePullBackOff|ErrImagePull|Evicted' | awk '{print $2 " --namespace=" $1}' | xargs kubectl delete pod --grace-period=0 --force | |
# manual scaling adjustment | |
kubectl scale --replicas=0 deployment <deployment> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment