Learning · Kubernetes

Scheduling and placement

Affinity, taints, topology spread, and priorities — putting Pods where they belong without fighting the scheduler.

The scheduler binds Pods to nodes. Most “Pending forever” incidents are placement math, not magic.

Requests drive packing

The scheduler uses resource requests (not limits) for fit. Under-requesting packs too tight and causes noisy-neighbor eviction; over-requesting wastes cluster capacity and leaves Pods pending.

Affinity and anti-affinity

Attract Pods to nodes/Pods (or keep them apart) with label selectors. Soft (preferred) vs hard (required) rules change whether scheduling fails or merely prefers. Hard anti-affinity that cannot be satisfied = permanent Pending.

Taints and tolerations

Nodes taint themselves (or operators do) to repel general workloads — GPU nodes, spot pools, control-plane (historically), dedicated tenancy. Pods need matching tolerations to land there. Platform should document pool taints; apps should not invent private languages.

Topology spread

Spread replicas across zones or hosts so one failure domain does not take all replicas. Combine with PDBs for voluntary disruption. Three replicas in one AZ is a single storm away from zero.

Priority and preemption

PriorityClasses let important Pods preempt lower ones under pressure. Use sparingly and document the hierarchy — surprise preemption looks like random kills.

Node selectors and node affinity

Simple pool selection (nodeSelector / node affinity) for instance families, CPU arches, or local SSD. Prefer a small set of well-known labels from the platform team.

← Kubernetes