Bitzu

KCNA ยท Cluster administration and scheduling

Requests, limits and QoS classes

CPU/memory requests vs limits, QoS classes, throttling vs OOMKill, LimitRange and ResourceQuota.

Key points

  • Request: what the scheduler reserves for a container. Limit: the ceiling it may use.
  • Over CPU limit: throttled. Over memory limit: can be OOM-killed.
  • QoS class, derived from these: Guaranteed if requests equal limits for CPU and memory in every container.
  • Burstable: some requests or limits.
  • BestEffort: none; evicted first under node pressure.
  • LimitRange: per-object defaults and bounds. ResourceQuota: caps totals per namespace.

Source: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/

Practice questions

Single choice

Which value does the scheduler use to decide whether a Pod fits on a node?

  1. The container's limits
  2. The container's requests
  3. The container's image size
  4. The Pod's restart count
Show answer

Answer: B. The container's requests

The scheduler sums container requests and compares them with unreserved node capacity. Limits are ceilings enforced at runtime.

Select all that apply

Which statements about QoS classes are correct?

  1. The class is derived from requests and limits
  2. BestEffort Pods are evicted before Burstable and Guaranteed
  3. Guaranteed needs requests equal to limits for CPU and memory
  4. You set the class by writing status.qosClass yourself
  5. Burstable Pods are always evicted last
Show answer

Answer: A. The class is derived from requests and limits, B. BestEffort Pods are evicted before Burstable and Guaranteed, C. Guaranteed needs requests equal to limits for CPU and memory

QoS is derived from requests and limits, BestEffort goes first under pressure, and Guaranteed needs equal requests and limits for CPU and memory. You cannot set the class directly, and Guaranteed is evicted last, not first.

True or false

A container that exceeds its CPU limit is killed, just like one that exceeds its memory limit.

Show answer

Answer: False

False. CPU over the limit is throttled; only exceeding memory can lead to an OOM kill.

Practice 8 questions on this topic in Bitzu

Short lessons, instant explanations and spaced review of what you get wrong. Free on iOS and Android.

Download on the App StoreGet it on Google Play

More KCNA topics in this module