Skip to content

Requests vs Limits

Requests are guaranteed resources, while limits are the maximum resources a container can use.

Requests (Guaranteed)
Always available
Limits (Maximum)
Can't exceed

Mental Model

Requests are like reserving a table at a restaurant - they guarantee you'll have a spot. Limits are like a spending cap - you can't exceed it. If you don't specify a limit, you could consume all available resources.

YAML Example

apiVersion: v1
kind: Pod
spec:
  containers:
  - name: app
    image: myapp
    resources:
      requests:
        cpu: "500m"      # Guaranteed
        memory: "512Mi"  # Guaranteed
      limits:
        cpu: "1000m"     # Maximum
        memory: "1Gi"    # Maximum

Common Misconceptions

  • ✗Requests must equal limits - FALSE: They can be different
  • ✗Limits are required - FALSE: Optional but recommended
  • ✗CPU limits enforce max usage - TRUE: But memory limits can kill container

Key Takeaways

  • • Requests are guaranteed resources, while limits are the maximum resources a container can use.
  • • Requests are like reserving a table at a restaurant - they guarantee you'll have a spot. Limits are ...
  • • Check the YAML example for implementation details
  • • Be aware of the common misconceptions listed above
Kubernetes Cosmos•An interactive learning experience
Built by GLM 4.7