node affinity
Rules in a pod spec that say which nodes the pod must run on, or would prefer, based on node labels such as zone or hardware.
In more detail
A required rule is hard: if no node matches, the pod stays Pending as unschedulable. A preferred rule is soft and only influences scoring, which keeps alternatives open during failures. nodeSelector is the simplest hard form, an exact label match.
Related terms
- taint — A mark on a node that repels pods which do not tolerate it, used to reserve nodes or keep work off unhealthy ones.
- pod affinity — Rules that place a pod near, or with anti-affinity away from, other pods that carry certain labels, measured within a topology such as a node or zone.
- Kubernetes label — A small key and value pair attached to an object, such as app=web, that other objects and commands use to find it.
- unschedulable — The state of a pod that the scheduler cannot place on any node, which leaves it Pending with a FailedScheduling event explaining why.
Taught in
- Four Faults, Twelve Minutes — Certified Kubernetes Administrator (CKA) Exam Prep
- Placing Pods: Selectors, Affinity, Taints And Requests — Certified Kubernetes Administrator (CKA) Exam Prep
- StorageClasses: Why A Claim Waits For Its Pod — Certified Kubernetes Administrator (CKA) Exam Prep
- Sandboxed Pods: RuntimeClass And gVisor — Certified Kubernetes Security Specialist (CKS) Exam Prep
- Pending All Saturday: How The Scheduler Places Pods — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Fundamentals Sprint: Four Tickets Before The Doors Open — Kubernetes and Cloud Native Associate (KCNA) Exam Prep
- Worker Nodes: kubelet, Runtime, CNI And kube-proxy — Kubernetes: Production-Grade Container Orchestration
- DaemonSets And Node Services — Kubernetes: Production-Grade Container Orchestration
- Requests, Limits, Quotas And Horizontal Autoscaling — Kubernetes: Production-Grade Container Orchestration
- Node Affinity, Pod Affinity And Topology Spread — Kubernetes: Production-Grade Container Orchestration