Kubernetes interview question · Most asked

What is the difference between resource requests and limits, and what are the QoS classes?

Summary

Requests are what the scheduler reserves and what the pod is guaranteed; limits are the maximum it may use. Exceeding the memory limit gets the container OOM-killed; exceeding the CPU limit gets it throttled. QoS classes follow from them: Guaranteed (requests equal limits for all containers), Burstable (some requests or limits set), BestEffort (none), and under node memory pressure BestEffort pods are evicted first.

Longer Answer

Practical guidance many teams follow: always set memory requests and limits (often equal, since memory cannot be throttled), always set CPU requests, and be careful with CPU limits, because CFS quotas throttle bursts in short periods and cause latency spikes even when the node has idle CPU. Size requests from observed usage (VPA recommendations, metrics), not guesses.

Namespaces can enforce defaults and caps with LimitRange and ResourceQuota.

Key Points

  • Requests: scheduling and guarantees.
  • Limits: memory OOM-kill, CPU throttling.
  • Guaranteed, Burstable, BestEffort.
  • Careful with CPU limits; size from metrics.

More most-asked Kubernetes questions

← All Kubernetes questions