Kubernetes
Pod
Insufficient CPU
Troubleshooting
Resource Allocation

Pod in pending state due to Insufficient CPU

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Introduction

A pod stays in Pending with an Insufficient CPU message when the scheduler cannot find any node that satisfies the pod's CPU request. The important detail is that Kubernetes schedules against requested resources, not current observed CPU usage. So a cluster can look underutilized in dashboards and still reject a new pod if the requested millicores do not fit anywhere.

Confirm the Scheduling Error

Start with the pod events. They tell you whether the scheduler is blocked by CPU or by something else such as node selectors, taints, or affinity rules.

bash
kubectl describe pod my-pod

A typical event looks like:

text
0/3 nodes are available: 3 Insufficient cpu.

Then check node allocatable CPU rather than only raw capacity.

bash
kubectl describe node worker-1
kubectl top nodes

Allocatable is what the scheduler can actually use after reserving space for the system and Kubernetes components.

Requests Drive Scheduling

The scheduler compares each container's CPU request against node allocatable CPU. If the pod requests 2000m and no node has that much schedulable CPU left, the pod remains pending.

A simple example:

yaml
1apiVersion: v1
2kind: Pod
3metadata:
4  name: cpu-heavy
5spec:
6  containers:
7    - name: app
8      image: nginx
9      resources:
10        requests:
11          cpu: "2000m"
12        limits:
13          cpu: "2000m"

If every node has only 1500m allocatable CPU free, this pod will never schedule even if actual live usage looks low.

Check for Overstated Requests

One of the most common causes is a request that is far larger than the workload really needs. The fix is not to remove requests entirely, but to size them realistically.

yaml
1resources:
2  requests:
3    cpu: "250m"
4  limits:
5    cpu: "1000m"

That gives the scheduler a more reasonable baseline while still allowing burst capacity up to the CPU limit.

If the application genuinely needs a large guaranteed CPU reservation, then the fix is cluster capacity, not YAML edits.

Fragmentation and Scheduling Constraints

Sometimes the total free CPU across the cluster is enough, but no single node has enough contiguous allocatable CPU for the pod. This is effectively fragmentation at the scheduling layer.

Other constraints can make the problem look like CPU when it is actually more specific:

  • node selectors restrict the pod to a small subset of nodes
  • affinity rules narrow the eligible nodes
  • taints and tolerations exclude otherwise healthy nodes
  • resource quotas block new requests in the namespace

That is why kubectl describe pod is more useful than guessing from a cluster dashboard alone.

Practical Fixes

A safe troubleshooting order is:

  1. inspect the pod events
  2. inspect node allocatable CPU
  3. compare the request against realistic workload needs
  4. check autoscaling and node-pool capacity
  5. review selectors, affinity, taints, and quotas

If the cluster uses Cluster Autoscaler, make sure the pending pod is actually eligible to trigger scale-up. Some constraints can prevent autoscaling from helping.

Example Diagnostic Commands

bash
1kubectl describe pod my-pod
2kubectl get pod my-pod -o yaml
3kubectl describe nodes
4kubectl top nodes
5kubectl get resourcequota -A

That set of commands usually reveals whether the issue is oversized requests, limited allocatable CPU, or a scheduling rule that reduced the candidate nodes too much.

Common Pitfalls

  • Looking at live CPU usage and assuming that is what the scheduler uses.
  • Setting CPU requests equal to peak load instead of typical guaranteed need.
  • Ignoring node selectors, affinity, and taints that reduce eligible nodes.
  • Forgetting that allocatable CPU is smaller than raw node capacity.
  • Expecting autoscaling to help when scheduling constraints prevent scale-up.

Summary

  • 'Insufficient CPU means the scheduler cannot place the pod based on requested CPU.'
  • Scheduling uses resource requests and allocatable CPU, not just current observed usage.
  • Oversized requests are a common cause of pending pods.
  • Node selectors, affinity, taints, and quotas can make the problem worse.
  • Diagnose with pod events and node descriptions before changing the deployment.

Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track what you have practised

A free account saves your progress, solutions and study plan across every problem on Codemia.

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

All Rights Reserved.