Sometimes, when you deploy something to Kubernetes, you end up with a pod which stays in the "Terminating" phase. Very annoying as whatever you do in your Kubernetes client or via kubectl delete, the pod just stays there.

The first thing you can try is to set the termination grace period to 0:

$ kubectl delete pod <pod_name> -n <namespace> --grace-period 0

If that doesn't work, your last resort is to force the operation:

$ kubectl delete pod <pod_name> -n <namespace> --grace-period 0 --force

You should however only do that if you are certain the pod is no longer running. If the pod is still running while you forcefully delete it, it may continue to run in the cluster indefinitely.

You can find more information about this in the Kubernetes documentation.

Related Posts

  • My favourite Kubernetes client: Lens
  • Stern 1.13.0, templates and line-endings
  • Installing Helm on your Kubernetes cluster
  • Setting up and using an NFS share in Kubernetes
  • Using Docker private repos in Kubernetes