⎈ k8s knowledge compiler

Pod Quality of Service Classes [page]deterministic

conceptsnetworking

This page introduces _Quality of Service (QoS) classes_ in Kubernetes, and explains how Kubernetes assigns a QoS class to each Pod as a consequence of the resource constraints that you specify for the containers in that Pod. Kubernetes relies on this classification to make decisions about which Pods to evict when there are not enough available resources on a Node.

## Quality of Service classes

Kubernetes classifies the Pods that you run and allocates each Pod into a specific _quality of service (QoS) class_. Kubernetes uses that classification to influence how different pods are handled. Kubernetes does this classification based on the [resource requests](/docs/concepts/configuration/manage-resources-containers/) of the [Containers](#gloss:container) in that Pod, along with how those requests relate to resource limits. This is known as [Quality of Service](#gloss:qos-class) (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](/docs/concepts/scheduling-eviction/node-pressure-eviction/). The possible QoS classes are `Guaranteed`, `Burstable`, and `BestEffort`. When a Node runs out of resources, Kubernetes will first evict `BestEffort` Pods running on that Node, followed by `Burstable` and finally `Guaranteed` Pods. When this eviction is due to resource pressure, only Pods exceeding resource requests are candidates for eviction.

### Guaranteed

Pods that are `Guaranteed` have the strictest resource limits and are least likely to face eviction. 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. They may not acquire resources beyond their specified limits. These Pods can also make use of exclusive CPUs using the [`static`](/docs/tasks/administer-cluster/cpu-management-policies/#static-policy-configuration) CPU management policy.

#### Criteria

For a Pod to be given a QoS class of `Guaranteed`:

* Every Container in the Pod must have a memory limit and a memory request, both greater than zero. * For every Container in the Pod, the memory limit must equal the memory request. * Every Container in the Pod must have a CPU limit and a CPU request, both greater than zero. * For every Container in the Pod, the CPU limit must equal the CPU request.

If instead the Pod uses [Pod-level resources](/docs/concepts/configuration/manage-resources-containers/#pod-level-resource-specification):

* The Pod must have a Pod-level memory limit and memory request, and their values must be equal. * The Pod must have a Pod-level CPU limit and CPU request, and their values must be equal.

### Burstable

Pods that are `Burstable` have some lower-bound resource guarantees based on the request, but do not require a specific limit. 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. In the event of Pod eviction due to Node resource pressure, these Pods are evicted only after all `BestEffort` Pods are evicted. Because a `Burstable` Pod can include a Container that has no resource limits or requests, a Pod that is `Burstable` can try to use any amount of node resources.

#### Criteria

A Pod is given a QoS class of `Burstable` if:

* 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, or the Pod has a Pod-level memory or CPU request or limit.

### BestEffort

Pods in the `BestEffort` QoS class can use node resources that aren't specifically assigned to Pods in other QoS classes. 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 remai …(trimmed)

Sources

concepts/workloads/pods/pod-qos.md · docPod Quality of Service Classes

Related (13)

references ContainerContainers conf=1
references QoS ClassQuality of Service conf=1
part_of Quality of Service classesdescribes conf=1
part_of Memory QoS with cgroup v2describes conf=1
part_of {{% heading "whatsnext" %}}describes conf=1
part_of Guaranteeddescribes conf=1
part_of Burstabledescribes conf=1
part_of BestEffortdescribes conf=1
part_of Memory throttlingdescribes conf=1
part_of Configuring memory reservationdescribes conf=1
part_of System requirementsdescribes conf=1
api_for Poddocuments API object conf=1

← all Docs