Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pods stuck in Terminating status

Tags:

kubernetes

I tried to delete a ReplicationController with 12 pods and I could see that some of the pods are stuck in Terminating status.

My Kubernetes cluster consists of one control plane node and three worker nodes installed on Ubuntu virtual machines.

What could be the reason for this issue?

NAME        READY     STATUS        RESTARTS   AGE pod-186o2   1/1       Terminating   0          2h pod-4b6qc   1/1       Terminating   0          2h pod-8xl86   1/1       Terminating   0          1h pod-d6htc   1/1       Terminating   0          1h pod-vlzov   1/1       Terminating   0          1h 
like image 416
Dimuthu Avatar asked Feb 17 '16 10:02

Dimuthu


People also ask

Why pods are stuck in terminating state?

A pod has been deleted, and remains in a status of Terminated for more than a few seconds. This can happen because: the pod has a finalizer associated with it that is not completing, or. the pod is not responding to termination signals.

How do you restart a terminating pod?

Restart Pods in Kubernetes with the rollout restart CommandBy running the rollout restart command. Run the rollout restart command below to restart the pods one by one without impacting the deployment ( deployment nginx-deployment ). Now run the kubectl command below to view the pods running ( get pods ).

What happens when a pod is terminated?

Terminated. A container in the Terminated state began execution and then either ran to completion or failed for some reason. When you use kubectl to query a Pod with a container that is Terminated , you see a reason, an exit code, and the start and finish time for that container's period of execution.


1 Answers

You can use following command to delete the POD forcefully.

kubectl delete pod <PODNAME> --grace-period=0 --force --namespace <NAMESPACE> 
like image 175
Nitin Avatar answered Sep 28 '22 07:09

Nitin