Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't delete pods in pending state?

Tags:

kubernetes

[root@vpct-k8s-1 kubernetes]# kubectl get pods --all-namespaces
NAMESPACE     NAME               READY     STATUS    RESTARTS   AGE
kube-system   kube-ui-v2-ck0yw   0/1       Pending   0          1h

[root@vpct-k8s-1 kubernetes]# kubectl get rc --all-namespaces
NAMESPACE     CONTROLLER   CONTAINER(S)   IMAGE(S)                               SELECTOR                REPLICAS      AGE
kube-system   kube-ui-v2   kube-ui        gcr.io/google_containers/kube-ui:v2   k8s-app=kube-ui,version=v2   1          1h

Can't delete pods in pending state?

like image 703
AdaiBee Avatar asked Dec 29 '15 10:12

AdaiBee


People also ask

How do I remove a pod from pending state?

The only ways in which a Pod in such a state can be removed from the apiserver are as follows: The Node object is deleted (either by you, or by the Node Controller). The kubelet on the unresponsive Node starts responding, kills the Pod and removes the entry from the apiserver. Force deletion of the Pod by the user.

How do you force delete all pods in Kubernetes?

First, confirm the name of the node you want to remove using kubectl get nodes , and make sure that all of the pods on the node can be safely terminated without any special procedures. Next, use the kubectl drain command to evict all user pods from the node.

Why pods are stuck in terminating state?

A pod is stuck in a terminating state as the configmap mounted as a volume fails to unmount when trying to clean the subPath mount for it.


1 Answers

kubectl get ns
kubectl get pods --all-namespaces
kubectl get deployment -n (namespacename)
kubectl get deployments --all-namespaces
kubectl delete deployment (podname) -n (namespacename)
like image 63
Babu Rao Avatar answered Oct 23 '22 18:10

Babu Rao