Last active
January 4, 2021 11:33
-
-
Save babvin/cc43aa0cac44fc10ca138d4590a766b0 to your computer and use it in GitHub Desktop.
Delete pods which are stuck at terminating
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 one: kubectl delete pod <PODNAME> --grace-period=0 --force --namespace <NAMESPACE> | |
For Many: kubectl get pods --all-namespaces | grep Terminating | while read line; do | |
pod_name=$(echo $line | awk '{print $2}' ) name_space=$(echo $line | awk '{print $1}' ); kubectl delete pods $pod_name -n $name_space --grace-period=0 --force; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment