Can't delete pods in pending state?

12/29/2015
[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?

-- AdaiBee
kubernetes

3 Answers

12/29/2015

Depending on the number of replicas you specified while creating the cluster, you might be able to delete the pending pod but another pod will be recreated automatically. You can delete the pod by running this command:

$ ./cluster/kubectl.sh delete pod kube-ui-v2-ck0yw
-- George
Source: StackOverflow

5/9/2019
kubectl get ns
kubectl get pods --all-namespaces
kubectl get deployment -n (namespacename)
kubectl get deployments --all-namespaces
kubectl delete deployment (podname) -n (namespacename)
-- Babu Rao
Source: StackOverflow

5/13/2019

Try the below command

kubectl delete pod kube-ui-v2-ck0yw --grace-period=0 --force -n kube-system
-- dassum
Source: StackOverflow