Skip to main content

Pod: Quality of Service Class

Kubernetes classifies the Pods that we run and allocates each Pod into a specific quality of service (QoS) class. Kubernetes assigns every Pod a QoS class based on the resource requests and limits of its component Containers. QoS classes are used by Kubernetes to decide which Pods to evict from a Node experiencing Node Pressure.

The possible QoS classes are Guaranteed, Burstable, and BestEffort.

Guaranteed​

  • This is the highest QoS class in kubernetes. These pods are the least likely to face eviction.
  • Never throttled as long as limits are not exceeded.
  • They are guaranteed not to be killed until they exceed their limits or there are no lower-priority Pods that can be preempted from the Node.

Criteria:

  • Every container in the pod must have CPU request and limit with equal value.
  • Every container in the pod must have Memory request and limit with equal value.

Burstable​

  • Higher priority than BestEffort but lower than Guaranteed.
  • If a limit is not specified, it defaults to a limit equivalent to the capacity of the Node, which allows the Pods to flexibly increase their resources if resources are available (burstsable).
  • Can get throttled or evicted if usage exceeds requests.

Criteria:

  • The Pod does not meet the criteria for QoS class Guaranteed.
  • At least one Container in the Pod has a memory or CPU request or limit.

BestEffort​

  • This is the lowest QoS class in kubernetes.

  • These pods are the most likely to face eviction.

  • These pods will use any amount of compute resource available.

    For example, if you have a node with 16 CPU cores available to the kubelet, and you assign 4 CPU cores to a Guaranteed Pod, then a Pod in the BestEffort QoS class can try to use any amount of the remaining 12 CPU cores.

Eviction Order​

When Kubernetes needs to evict pods due to CPU or Memory limit, it follows this order.

  • BestEffort Pods (No CPU/memory requests set)
  • Burstable Pods (Some requests but no strict limits)
  • Guaranteed Pods (Requests = Limits)

References​