DEV Community

Arun Kumar Singh
Arun Kumar Singh

Posted on

How to delete Kubernetes pods hanging in Terminating state

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
Enter fullscreen mode Exit fullscreen mode

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
Enter fullscreen mode Exit fullscreen mode

Oldest comments (0)