How to delete Kubernetes pods hanging in Terminating state
Arun Kumar Singh
Posted on April 6, 2021
While working on Kubernetes environment you may see hanging PODs after termination. You will see the state of Terminating
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
nginx 0/1 Terminating 0 1d
This can hold your work for sometime. In these cases you need to find the root cause of this issue but in the mean time if you want to quickly get rid of those pods, run following command -
$ kubectl delete pod <pod-name> -n <namespace> --grace-period=0 --force
💖 💪 🙅 🚩
Arun Kumar Singh
Posted on April 6, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
kubernetes Taming the Wild West of Research Computing: How Policies Saved Us a Thousand Headaches
November 29, 2024
kubernetes Setting Up a Production-Ready Kubernetes Cluster with RKE2 in vSphere Using Terraform
November 29, 2024