Skip to main content
Kubernetes FailedScheduling: Taints, Affinity, and Resources

Kubernetes FailedScheduling: Taints, Affinity, and Resources

KU
· Founder & Chief Editor
• 7 min read•Updated •55 views

A pod sits Pending and the scheduler quietly logs why it rejected every node. Learn to read that one line and fix the real cause instead of guessing.

Key takeaways

  • FailedScheduling means no node passed every scheduler check, and the event message lists why each node failed.
  • Run kubectl describe pod, read the tally, then fix the named cause: lower inflated requests, add a toleration, correct a node selector typo, relax required anti-affinity, or use a WaitForFirstConsumer StorageClass.
  • Scale nodes only for genuine capacity shortfalls.

Fix FailedScheduling by reading the event's tally with kubectl describe pod: it says how many nodes failed for each reason. Insufficient cpu means lower requests or add capacity; an untolerated taint needs a toleration; an affinity mismatch is usually a label typo; a volume conflict needs a WaitForFirstConsumer StorageClass. Scale nodes only for real shortfalls.

Verified against

Kubernetes v1.37 (v1.37.2, released October 2026), kubectl v1.37, against the kubernetes.io taints and tolerations, assigning pods to nodes, topology spread constraints and storage classes docs. Checked October 2026.

The event means the scheduler did its job and came up empty. It ran every node through its filters, and not a single node passed all of them. The pod stays Pending. Nothing is broken; the cluster is telling you, in one dense line, that what you asked for and what you have don't line up.

The mistake we see most is scaling the node group the moment a pod sits Pending. Sometimes that's right. Often it's not, and you've just paid for capacity that won't fix a taint or an affinity typo. Read the event first.

Read the event, not the vibes

code
$ kubectl describe pod api-7f9c8-2xk4p

Scroll to the bottom:

code
Events:
  Type     Reason            Age   From               Message
  ----     ------            ----  ----               -------
  Warning  FailedScheduling  47s   default-scheduler  0/5 nodes are available: 3 Insufficient cpu, 2 node(s) had untolerated taint {dedicated: gpu}. preemption: 0/5 nodes are available: 3 No preemption victims found, 2 Preemption is not helpful for scheduling.

That message is a manifest. 0/5 nodes are available is the headline. The comma-separated list is a tally of why each node failed, and the counts add up to your node total. Here: three nodes had no CPU room, two carried a taint the pod didn't tolerate. Five nodes, zero fits.

Learn to parse each phrase. Below are the ones you'll actually meet.

Insufficient cpu / Insufficient memory

code
0/5 nodes are available: 5 Insufficient cpu.

The pod's total CPU requests (not limits, requests) exceed what's free on every node. Free means allocatable minus what's already reserved by other pods, whether or not they're using it. A node can sit at 10% real utilization and still reject a pod because everything on it over-requested.

Two fixes. If the request is honest, add capacity. If it's inflated (and a lot of resources.requests are copy-pasted guesses), lower it:

YAML
# deployment.yaml (container spec)
resources:
  requests:
    cpu: "250m"      # was "2" because nobody measured
    memory: "256Mi"

Check what's actually free before you decide:

code
$ kubectl describe node ip-10-0-1-14 | grep -A5 "Allocated resources"

This is the same territory as a pod Pending that never gets placed: resource math is the most common root cause.

Untolerated taint

code
2 node(s) had untolerated taint {dedicated: gpu: NoSchedule}.

Someone tainted those nodes to keep general workloads off them. Your pod isn't allowed there unless it carries a matching toleration. If this pod should run there:

YAML
# pod spec
tolerations:
- key: "dedicated"
  operator: "Equal"
  value: "gpu"
  effect: "NoSchedule"

If it shouldn't, the event is doing its job: those nodes are reserved and the pod belongs elsewhere. A toleration only grants permission; it doesn't pull the pod onto the node. That's affinity's job.

Node affinity / nodeSelector didn't match

code
0/5 nodes are available: 5 node(s) didn't match Pod's node affinity/selector.

You asked for nodes with a label none of them carry. Ninety percent of the time it's a typo or a zone that doesn't exist. Print the labels:

code
$ kubectl get nodes -L topology.kubernetes.io/zone,node.kubernetes.io/instance-type

Then reconcile your selector with reality:

YAML
# pod spec
affinity:
  nodeAffinity:
    requiredDuringSchedulingIgnoredDuringExecution:
      nodeSelectorTerms:
      - matchExpressions:
        - key: node.kubernetes.io/instance-type
          operator: In
          values: ["m6i.large", "m6i.xlarge"]

Use required when the pod genuinely cannot run elsewhere. Reach for preferredDuringScheduling when it's a nudge, not a law. required plus a label typo is how you strand a pod forever.

Pod affinity / anti-affinity

code
0/5 nodes are available: 5 node(s) didn't satisfy existing pods anti-affinity rules.

Common with a StatefulSet that spreads replicas one-per-node using requiredDuringScheduling anti-affinity. Ask for four replicas on a three-node cluster and the fourth has nowhere legal to sit. Either add a node or loosen the rule to preferred:

YAML
# statefulset.yaml (pod template spec)
affinity:
  podAntiAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
    - weight: 100
      podAffinityTerm:
        labelSelector:
          matchLabels:
            app: cache
        topologyKey: kubernetes.io/hostname

preferred still spreads pods when it can, but it won't wedge the deploy when it can't.

Volume zone conflict

code
0/3 nodes are available: 3 node(s) had volume node affinity conflict.

This one trips everybody. An EBS volume lives in one availability zone. A pod bound to that PVC can only schedule onto nodes in the same zone. If your only free capacity is in us-east-1b and the volume is in us-east-1a, no dice. Check the PV:

code
$ kubectl get pv <name> -o jsonpath='{.spec.nodeAffinity}'

The durable fix is a WaitForFirstConsumer StorageClass so the volume is provisioned after the scheduler picks a zone, not before:

YAML
# storageclass.yaml
volumeBindingMode: WaitForFirstConsumer

If the claim itself never binds, that is a different event; fixing a PVC stuck in Pending covers the provisioner side.

Unschedulable / cordoned nodes

code
0/5 nodes are available: 2 node(s) were unschedulable, 3 Insufficient cpu.

unschedulable means someone ran kubectl cordon (or a drain in progress) and those nodes won't accept new pods. Sometimes that's a forgotten cordon from last week's maintenance. Confirm and uncordon:

code
$ kubectl get nodes | grep SchedulingDisabled
$ kubectl uncordon ip-10-0-1-22

Topology spread constraints

code
0/6 nodes are available: 3 node(s) didn't match pod topology spread constraints.

You've asked the scheduler to balance replicas across zones or nodes within a maxSkew, and honoring it would break the limit. With whenUnsatisfiable: DoNotSchedule, the pod waits. If even spread matters less than getting the pod running, switch to ScheduleAnyway:

YAML
# deployment.yaml (pod template spec)
topologySpreadConstraints:
- maxSkew: 1
  topologyKey: topology.kubernetes.io/zone
  whenUnsatisfiable: ScheduleAnyway
  labelSelector:
    matchLabels:
      app: api

Questions people ask

What does "0/3 nodes are available" mean in Kubernetes?

It means the scheduler checked all three nodes and none passed every filter for this pod, so the pod stays Pending. The rest of the message lists a reason and a count for each failure, such as 2 Insufficient cpu or 1 node(s) had untolerated taint. The counts cover every node, so the largest group usually names the fix. Read it with kubectl describe pod <name>.

Does a toleration force a pod onto a tainted node?

No. A toleration only permits scheduling onto a node with a matching taint; the Kubernetes docs say tolerations allow scheduling but don't guarantee it. To steer a pod onto dedicated nodes, combine the toleration with node affinity or a nodeSelector that matches a label on those nodes. The taint keeps other workloads off, and the affinity pulls yours on.

Will the cluster autoscaler fix FailedScheduling?

Only when adding a node would actually let the pod fit. The autoscaler simulates scheduling on a new node from your node groups, so it helps with Insufficient cpu or Insufficient memory. It cannot fix a label typo, a missing toleration, a volume pinned to another zone, or required anti-affinity that no new node satisfies. Fix those in the manifest instead.

The call we'd make

Read the tally before you touch anything. The count after each phrase tells you how many nodes failed for that reason, and that alone usually points at the fix: taints and affinity are almost always a manifest problem you solve in the YAML, while Insufficient cpu split evenly across every node is the one case where scaling is honest. Fix inflated requests before you add nodes: measured requests fix more Pending pods than a bigger cluster ever will. And keep required rules for things that are genuinely required; everything softer belongs in preferred, where a bad label can't strand a workload. For the wider map of failure modes, our Kubernetes troubleshooting guide connects the events that tend to show up together.

Sources

Explore topics:KubernetesDevOps
React
Share this post
Cite this article
Plain text

Kiril Urbonas (2026). Kubernetes FailedScheduling: Taints, Affinity, and Resources. DevOpsNess. Updated 2026-10-31. https://www.devopsness.com/blog/fix-failedscheduling

Markdown

[Kubernetes FailedScheduling: Taints, Affinity, and Resources](https://www.devopsness.com/blog/fix-failedscheduling) (Kiril Urbonas, DevOpsNess, updated 2026-10-31)

KU

Kiril Urbonas

Founder & Chief Editor

586 articles
View all articles by Kiril Urbonas

You might have missed

Evergreen posts worth revisiting.