Pod stuck in Pending: reading the FailedScheduling message

Reproduced on k3s v1.31.5 (k3d) with kubectl v1.36.1.

What you see

$ kubectl get pod pending-demo -n lab -o wide
NAME           READY   STATUS    RESTARTS   AGE    IP       NODE
pending-demo   0/1     Pending   0          104s   <none>   <none>

$ kubectl describe pod pending-demo -n lab
Events:
  Type     Reason            Age                 From               Message
  ----     ------            ----                ----               -------
  Warning  FailedScheduling  2m35s               default-scheduler  0/2 nodes are available: 2 Insufficient cpu. preemption: 0/2 nodes are available: 2 No preemption victims found for incoming pod.
  Warning  FailedScheduling  20s (x2 over 2m7s)  default-scheduler  0/2 nodes are available: 2 Insufficient cpu. preemption: 0/2 nodes are available: 2 No preemption victims found for incoming pod.

What it means

Pending is a pod phase, not an error. It covers the time before the pod is bound to a node and the time spent pulling images. If NODE is <none>, the pod has not been scheduled yet.

The scheduler checks every node against the pod's requests, node selectors, affinity, taints and volume needs. The FailedScheduling message groups the nodes by the reason they were rejected. The numbers add up to the total node count. If that total is not the number of nodes you expected, the cluster has grown or shrunk since you last looked, for example through autoscaling.

Requests count, not real usage. A nearly idle node can still reject a pod if the requests of the pods already on it fill its allocatable CPU.

Common causes

Not enough CPU or memory requested room

No node has enough unrequested CPU or memory for the pod's requests. Large requests or a full cluster cause this. A request bigger than the allocatable of your largest node never fits, even on an empty cluster.

How to tell: The message says Insufficient cpu or Insufficient memory.

Node selector or affinity does not match

The pod asks for a label that no ready node has, such as a zone, instance type or GPU label.

How to tell: The message says didn't match Pod's node affinity/selector.

Taints the pod does not tolerate

Nodes are tainted for special workloads or because they are unhealthy. The pod has no matching toleration.

How to tell: The message says had untolerated taint followed by the taint key.

Volume cannot be bound or reached

A PersistentVolumeClaim is not bound, or the volume is in a zone where no node can run the pod.

How to tell: The message mentions unbound immediate PersistentVolumeClaims or volume node affinity conflict.

Spread or anti-affinity rules

Pod anti-affinity or topology spread constraints leave no valid place for another replica.

How to tell: The message mentions didn't match pod anti-affinity rules or topology spread constraints.

No scheduler picks it up

The pod names a schedulerName that is not running. No events are written at all.

How to tell: The pod is Pending with no FailedScheduling events and spec.schedulerName is not default-scheduler.

How to diagnose it

  1. kubectl describe pod <pod> -n <namespace>

    Read the FailedScheduling event at the bottom. Each reason is listed with how many nodes it ruled out.

  2. kubectl get events -n <namespace> --field-selector reason=FailedScheduling --sort-by=.lastTimestamp

    Shows every unschedulable pod in the namespace. Many pods with the same reason point to a cluster capacity problem.

  3. kubectl describe node <node>

    Check Allocated resources against Allocatable, plus Taints and Labels. This tells you how close each node is to full.

  4. kubectl get pod <pod> -n <namespace> -o jsonpath='{.spec.containers[*].resources.requests}'

    Compare what the pod asks for with the Allocatable of your largest node. Init containers and sidecars count too.

  5. kubectl get nodes -o custom-columns=NAME:.metadata.name,TAINTS:.spec.taints

    Lists taints per node in one view. Compare them with the pod's tolerations.

  6. kubectl get pvc -n <namespace>

    Every claim the pod uses should be Bound. For a Pending claim, run kubectl describe pvc and read its events. A StorageClass that names a missing provisioner, a cloud quota or a zone the volume cannot be made in are common reasons.

How to fix it

Lower the requests

Set requests to what the app really uses, based on metrics. Oversized requests are a common cause in clusters with spare real capacity.

Trade-off: Requests set too low lead to CPU throttling, node overcommit and a higher chance of OOM kills or eviction.

Add capacity

Add nodes, or let the cluster autoscaler add them. Make sure the node group can create nodes that match the pod's selectors and taints. The cluster autoscaler writes a TriggeredScaleUp or NotTriggerScaleUp event on the pod, so you can see whether it is acting.

Trade-off: More nodes cost more. The autoscaler only helps if a node group exists that the pod can actually land on.

Relax placement rules

Fix the node selector or affinity, add the right toleration, or change required anti-affinity to preferred. For a taint, copy the key, value and effect from the FailedScheduling message into a toleration.

tolerations:
  - key: "workload"
    operator: "Equal"
    value: "spot"
    effect: "NoSchedule"

Trade-off: The pod may land on nodes meant for other work, or replicas may share a node and fail together.

Use priority and preemption

Give important pods a higher PriorityClass so the scheduler can evict lower priority pods to make room.

Trade-off: Lower priority workloads get evicted without warning. Set this up on purpose, not as a quick fix.

How to stop it coming back

  • Base requests on observed usage and review them after big changes.
  • Alert on pods Pending longer than a few minutes, grouped by FailedScheduling reason.
  • Keep some headroom in each node group, or run an autoscaler with limits that fit your largest pod.
  • Watch ReplicaSet events too. A ResourceQuota rejection never creates a Pending pod. It shows as FailedCreate on the ReplicaSet instead.
  • Use an admission policy, for example Kyverno or OPA Gatekeeper, to reject pods that request more than your largest node can hold.

How KubeGraf investigates it

KubeGraf watches your clusters for failures such as CrashLoopBackOff, OOMKilled pods and stuck rollouts. How KubeGraf handles Kubernetes incidents.

Frequently asked questions

What does FailedScheduling mean?

It is the scheduler's event for a pod it could not place. The message groups the nodes by the reason each one was rejected. A Pending pod with no FailedScheduling events at all may name a scheduler that is not running.

What does 0/3 nodes are available mean?

The scheduler checked 3 nodes and none of them fit. The rest of the message says why, such as 3 Insufficient cpu. The counts add up to the total node count.

How do I fix Insufficient cpu?

The pod's CPU request does not fit in the unrequested CPU of any node. Requests count, not real usage. Lower the request to what the app really uses or add nodes.

Why is my pod unschedulable?

Common reasons are requests that do not fit, a node selector no node matches, taints the pod does not tolerate, a volume that cannot bind or anti-affinity rules. Each one has its own wording in the FailedScheduling message.

Last updated . Try KubeGraf Freemium.

Related

Kubernetes documentation