Course contentsShow
← Cloud and Infrastructure
Lesson 1329 of 2,98927. Kubernetes Scheduling and ResourcesFree lesson

Understanding Resource Requests and Limits

Learn the fundamental difference between resource requests and limits in Kubernetes and why both are needed.

Understanding Resource Requests and Limits

You'll learn the critical difference between resource requests and limits in Kubernetes, and why you need both to run stable applications.

The Core Concept

In Kubernetes, every container can specify two types of resource constraints: requests and limits. Think of them like a hotel room reservation:

  • Requests are what you reserve — the guaranteed minimum resources the scheduler promises your container will have available.
  • Limits are the maximum you can use — a ceiling that prevents your container from consuming excessive resources and starving others.

Why Both Matter

Requests help the Kubernetes scheduler make smart decisions. When you ask for 500m CPU and 256Mi memory, the scheduler only places your Pod on a node with at least that much available. This ensures your application has breathing room to start and run reliably.

Limits act as safety guardrails. Without them, a single misbehaving container could consume all node resources, crashing everything. With a limit of 1 CPU and 512Mi memory, the container will be throttled (CPU) or terminated (memory) if it tries to exceed those boundaries.

The Gap Between Them

The space between requests and limits is your burst capacity. If your container is mostly idle but occasionally spikes, it can temporarily use more than its request (up to its limit) without being throttled — but only if the node has spare resources at that moment.

Real-World Analogy

Requests = your guaranteed parking spot. Limits = the parking garage ceiling height. You're promised a spot (request), but your RV can't be taller than 8 feet (limit) or it won't fit.

Key Takeaway: Resource requests guarantee minimum resources for scheduling and stability, while limits prevent runaway consumption — together they ensure fair resource sharing and predictable application behavior.