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, 2019 in Kubernetes by Sony
3,786 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, 2019 by Sirajul
• 59,230 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, 2019 in Kubernetes by Sirajul
• 59,230 points
2,165 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, 2019 in Kubernetes by Sirajul
• 59,230 points
1,142 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, 2019 in Kubernetes by Sirajul
• 59,230 points
1,180 views
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

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

answered Jan 17, 2019 in Others by anonymous
15,477 views
+15 votes
2 answers

Git management technique when there are multiple customers and need multiple customization?

Consider this - In 'extended' Git-Flow, (Git-Multi-Flow, ...READ MORE

answered Mar 27, 2018 in DevOps & Agile by DragonLord999
• 8,450 points
4,036 views
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, 2019 in Kubernetes by Sirajul
• 59,230 points
1,765 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, 2019 in Kubernetes by Sirajul
• 59,230 points
2,123 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP