Deep dive
Requests and Limits Are Not Just YAML
How Kubernetes uses resource requests and limits, and what happens when your assumptions are wrong.
- Kubernetes
- Platform Engineering
Two numbers, two jobs
Requests and limits look like a pair of similar fields. They drive completely different systems.
requests is used by the scheduler to decide where a pod can run. limits is enforced at runtime by the kernel. Confusing the two is the source of most “why is this behaving strangely” problems.
Where each value is actually consumed.
requests ──→ Scheduler ──→ which node?
limits ──→ kubelet ──→ how much?
│
├── CPU: throttled
└── Memory: OOM killedWhy the difference matters
CPU is compressible: hitting a CPU limit slows the process down. Memory is not: hitting a memory limit terminates it. The same-looking configuration has very different failure modes depending on which resource you are describing.
The practical lesson is to set requests from observed usage, treat limits as a policy decision rather than a guess, and remember that the scheduler never sees the limit at all.