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
1$ kubectl delete pod <pod_name> -n <namespace> --grace-period 0
If that doesn't work, your last resort is to force the operation:
1$ 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.
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.