Kubernetes Scheduling
Kubernetes scheduling is the process by which the scheduler assigns pods to nodes based on resource requirements, constraints, affinities, taints, and priorities. Understanding scheduling enables workload placement decisions that balance performance, cost, and availability.
itCloud native tools and technologies | OpenSkills.info
Recommended first:kubernetes-fundamentals
Course pathWalk it in order
Look it upDip in anytime
Go furtherLeaves this page
Don't Panic
Don't Panic: Kubernetes Scheduling
A Pod is a small promise that some containers should run. Kubernetes scheduling is the part that decides which node can keep that promise without breaking the promises already made to everyone else. It does not choose a node because the node looks cheerful, or because a CPU graph had a quiet afternoon. It works from the declarations in the Pod.
The kube-scheduler first filters out nodes that cannot take the Pod. Requests, labels, taints, affinity rules, and volume topology all get a vote, which is why a cluster with plenty of apparent headroom can still produce a very firm no. It then scores the survivors and binds the Pod to the winner. A Pod with no winner stays Pending, which is less a mystery than a receipt: its events say which rule ruled out the room.
The slightly alarming idea is that requests are the currency, not observed usage. A node can be idle and still be full for a Pod whose requested CPU or memory no longer fits its allocatable capacity. Those same requests help derive the QoS class, so they also influence who is evicted when a node runs short. A tiny YAML stanza has acquired an impressive amount of responsibility, as YAML often does when left unsupervised.
Placement controls are the furniture-moving rules. Node affinity and nodeSelector describe where a Pod may go. Taints make nodes say no unless a Pod carries a toleration. Pod anti-affinity and topology spread constraints decide how replicas avoid sharing the same failure domain. Each hard rule narrows the feasible set, so a resilience policy can become a Pending-Pod policy if replicas outnumber eligible places.
Contention has separate machinery. Priority and preemption can make room for important Pods by removing lower-priority ones. Node-pressure eviction is the kubelet protecting a starved node. PodDisruptionBudgets cover voluntary disruption such as drains, not every calamity with a capital letter. The useful habit is to decide which workloads may lose, wait, or move before capacity becomes scarce.
Read the Intro for the full path from filtering to eviction. Use the Slides when the mechanisms need a map rather than another paragraph. Keep the Cheatsheet nearby when a Pod is Pending, then follow the Reference links for the exact rules. The scheduler is not guessing. It is reading the rules with the literal-minded diligence of a machine that has never forgiven an ambiguous form.
Where this skill leads
Relevant careers
See how this topic contributes to broader role-level skill maps.
Sources
- https://kubernetes.io/docs/concepts/scheduling-eviction/
Supports
- Scheduling and eviction are connected placement and contention concerns.
- https://kubernetes.io/docs/concepts/scheduling-eviction/kube-scheduler/
Supports
- The scheduler filters feasible nodes, scores candidates, and binds the selected node.
- Pods without a feasible node remain Pending with recorded reasons.
- https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
Supports
- Requests are the scheduling currency and limits are runtime enforcement.
- Scheduling uses allocatable capacity and summed requests rather than current utilization.
- https://kubernetes.io/docs/concepts/workloads/pods/pod-qos/
Supports
- Guaranteed, Burstable, and BestEffort QoS classes derive from requests and limits.
- https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/
Supports
- Node selectors, affinity, anti-affinity, and topology key semantics steer placement.
- IgnoredDuringExecution applies rules at placement time, and anti-affinity has scale costs.
- https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
Supports
- NoSchedule, PreferNoSchedule, and NoExecute taint effects govern admission and eviction.
- Node conditions can add automatic taints, and dedicated node pools pair taints with labels.
- https://kubernetes.io/docs/concepts/scheduling-eviction/topology-spread-constraints/
Supports
- maxSkew, topologyKey, and whenUnsatisfiable govern distribution across topology domains.
- https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/
Supports
- PriorityClass and preemption can remove lower-priority Pods; PDB respect is best effort.
- https://kubernetes.io/docs/concepts/scheduling-eviction/node-pressure-eviction/
Supports
- The kubelet evicts Pods under memory, disk, or PID pressure using QoS, priority, usage, and requests.
- https://kubernetes.io/docs/concepts/scheduling-eviction/api-eviction/
Supports
- API-initiated eviction, including drain, respects PodDisruptionBudgets.
- https://kubernetes.io/docs/concepts/workloads/pods/disruptions/
Supports
- PodDisruptionBudgets distinguish voluntary disruption from involuntary failures.
- https://kubernetes.io/docs/concepts/scheduling-eviction/dynamic-resource-allocation/
Supports
- Dynamic Resource Allocation supports claims for specialized devices.
- https://kind.sigs.k8s.io/docs/user/quick-start/
Supports
- kind can create and delete isolated local Kubernetes clusters for the scheduling exercise.
- https://kubernetes.io/blog/2024/06/06/10-years-of-kubernetes/
Supports
- Kubernetes was announced in June 2014 and reached version 1.0 in July 2015.
- https://kubernetes.io/blog/2016/09/kubernetes-1-4-making-it-easy-to-run-on-kuberentes-anywhere/
Supports
- Kubernetes 1.4 introduced inter-Pod affinity and anti-affinity in alpha and introduced PodDisruptionBudget.
- https://kubernetes.io/blog/2017/03/advanced-scheduling-in-kubernetes/
Supports
- Kubernetes 1.6 placed advanced scheduling constructs into beta.
- https://kubernetes.io/blog/2019/04/16/pod-priority-and-preemption-in-kubernetes/
Supports
- Priority and preemption became generally available in Kubernetes 1.14 and can trade lower-priority interruption for faster critical placement.
- https://kubernetes.io/blog/2019/06/19/kubernetes-1-15-release-announcement/
Supports
- Kubernetes 1.15 introduced the Scheduling Framework as an alpha extension surface.
- https://kubernetes.io/blog/2020/05/introducing-podtopologyspread/
Supports
- Kubernetes 1.18 promoted PodTopologySpread to beta.
- https://kubernetes.io/blog/2022/12/15/dynamic-resource-allocation/
Supports
- Kubernetes 1.26 introduced Dynamic Resource Allocation as an alpha API.
- https://kubernetes.io/blog/2024/08/13/kubernetes-v1-31-release/
Supports
- Kubernetes 1.31 updated DRA with structured parameters and ResourceClaim scheduling behavior.
- https://www.usenix.org/conference/srecon22apac/presentation/ding
Supports
- Ant Group reports production failure chains that can stop Kubernetes Pod scheduling at fleet scale.
- https://kubernetes.io/
Supports
- Kubernetes supplies the core scheduler and Pod placement APIs.
- https://karpenter.sh/
Supports
- Karpenter provisions node capacity for Kubernetes workloads.
- https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler
Supports
- Cluster Autoscaler adds nodes for unschedulable Pods in configured node groups.
- https://volcano.sh/
Supports
- Volcano provides batch scheduling and gang scheduling capabilities for Kubernetes.
- https://yunikorn.apache.org/
Supports
- Apache YuniKorn provides queue-oriented scheduling for Kubernetes workloads.
- https://kueue.sigs.k8s.io/
Supports
- Kueue provides workload queueing and admission controls for Kubernetes batch workloads.
- https://github.com/kubernetes-sigs/descheduler
Supports
- Descheduler can rebalance or evict Pods after initial placement.
