how to debug a pending pod?

0 votes
I have a Kubernetes pod in a pending state.Why does this happen and how do i debug a pending pod?
Jul 15 in Kubernetes by Sony
18 views

1 answer to this question.

0 votes

Pending pod cannot be scheduled onto a node. 

Performing command  kubectl describe pod <pod_name> will help you undestand the problem.  

kubectl logs <pod> can also be helpful.  

Common reasons for pods getting stuck in Pending State are: 

1) When the pod requesting more resources than are available, for example a pod has set a request for an amount of CPU or  that is not available anywhere on any node. For example: requesting a 8 CPU cores when all your nodes only have 4 CPU cores. Doing a kubectl describe node <node> on each node will also show already requested resources. 

2) There are taints that prevent a pod from scheduling on your nodes. 

3) The nodes have been marked unschedulable with kubectl cordon 

4) There are no Ready nodes. kubectl get nodes will display the status of all nodes.
 

$ kubectl get po requests-pod-3
NAME             READY STATUS   RESTARTS AGE
requests-pod-3   0/1 Pending   0 4m

Examining why a pod is stuck at Pending with kubectl describe pod
 

$ kubectl describe po requests-pod-3
Name:       requests-pod-3
Namespace:  default
Node:       /  
...
Conditions:
  Type           Status 
  PodScheduled   False 
...
Events:
... Warning  FailedScheduling    No nodes are available
                                                        that match all of the 
                                                         following predicates::  
                                                          Insufficient cpu (1).
answered Jul 15 by Sirajul
• 19,070 points

Related Questions In Kubernetes

0 votes
1 answer

how to drain the traffic from a pod?

When we take the node for maintenance, ...READ MORE

answered Jul 17 in Kubernetes by Sirajul
• 19,070 points
16 views
0 votes
1 answer

How to configure a Pod to use the updated configMap?

If the config map is mounted into ...READ MORE

answered Jul 18 in Kubernetes by Sirajul
• 19,070 points
20 views
0 votes
1 answer

How to terminate a pod when a specific event occurs?

You need to add a liveness and ...READ MORE

answered Jul 19 in Kubernetes by Sirajul
• 19,070 points
19 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17 in Others by anonymous
1,647 views
+3 votes
1 answer
0 votes
1 answer

How do i tie a service to a pod or a set of pods?

By declaring pods with the label(s) and ...READ MORE

answered Jul 16 in Kubernetes by Sirajul
• 19,070 points
26 views
0 votes
1 answer

How to monitor that a pod is always running?

We can introduce probes.  A liveness probe with ...READ MORE

answered Jul 16 in Kubernetes by Sirajul
• 19,070 points
19 views