> Markdown version of https://opspane.dev/kubernetes/requests-limits/ for AI agents and readers: the same text, without navigation or the interactive tool.
>
> The tool computes its result with JavaScript in the browser, so this file holds the reference text, worked examples and FAQ. Open the page to run it on your own input.
>
> Link the Kubernetes QoS class & requests checker with a manifest: `m` (the YAML), plus optional node values `cpu` and `mem` (allocatable) and `cap` (memory capacity), e.g. https://opspane.dev/kubernetes/requests-limits/?m=kind%3A%20Pod%0Aspec%3A%0A%20%20containers%3A%0A%20%20-%20name%3A%20app%0A%20%20%20%20resources%3A%0A%20%20%20%20%20%20limits%3A%20%7Bcpu%3A%20500m%2C%20memory%3A%20256Mi%7D%0A&cap=16Gi
>
> Answer endpoint for agents: the same URL parameters on https://opspane.dev/kubernetes/requests-limits/answer.md return the computed result as Markdown, without JavaScript, e.g. https://opspane.dev/kubernetes/requests-limits/answer.md?m=kind%3A%20Pod%0Ametadata%3A%0A%20%20name%3A%20app%0Aspec%3A%0A%20%20containers%3A%0A%20%20-%20name%3A%20app%0A%20%20%20%20resources%3A%0A%20%20%20%20%20%20limits%3A%20%7Bcpu%3A%20500m%2C%20memory%3A%20256Mi%7D%0A&cap=16Gi

# Kubernetes QoS Class & Requests Checker

Paste a Pod or Deployment: get its QoS class and why, the Pod request with init and sidecar containers, oom_score_adj and how many Pods fit a node.

## Quick answer

- **Guaranteed**: every container, init and sidecar ones included, sets a cpu and a memory limit and each request equals its limit. A limit alone is enough: it is copied into the request.
- **Burstable**: at least one container sets a cpu or memory request or limit, but not every one matches.
- **BestEffort**: no container sets any cpu or memory request or limit.
- `oom_score_adj` is -997 for Guaranteed, 1000 for BestEffort, and for Burstable `1000 − 1000 × request ÷ capacity`, kept between 3 and 999: a 1Gi request on a 16Gi node gives 938.
- The Pod request is, per resource, the larger of the running containers' sum and the busiest init step.

## How to check a Pod's QoS class and requests

1. Paste a manifest: a Pod, Deployment, StatefulSet, DaemonSet, ReplicaSet, Job or CronJob, several separated by `---`, or the `kind: List` that `kubectl get -o yaml` prints.
2. Read the QoS class and the reason for it, then the findings. Where a fix is unambiguous a button applies it to the manifest; **Copy manifest** takes the result. A structural fix rewrites the YAML, so comments are dropped.
3. Optionally enter a node's allocatable CPU and memory to see how many Pods fit, and its memory capacity to see each container's `oom_score_adj`. `kubectl describe node` prints both under Capacity and Allocatable.

Quantities are read with the same rules as the resource units converter, so `128m` of memory, `512MB` and CPU in `Gi` are caught.

[Kubernetes resource units converter](https://opspane.dev/kubernetes/resource-units/)

## QoS classes and how each is decided

Kubernetes gives every Pod one of three classes when it is created, from the cpu and memory requests and limits of all its containers after defaulting. The class sets the kernel's `oom_score_adj` for the containers and the cgroup the kubelet places them in.

| Class | When | `oom_score_adj` |
| --- | --- | --- |
| **Guaranteed** | Every container (init and sidecar ones too) sets a cpu and a memory limit, and each request equals its limit. A limit alone is enough: the API server copies it into the request. | -997 |
| **Burstable** | Neither of the other two: at least one container sets a cpu or memory request or limit, but not every one matches. | 3 to 999, from the memory request |
| **BestEffort** | No container sets any cpu or memory request or limit. Other resources (ephemeral-storage, GPUs) do not count. | 1000 |

The rule runs container by container, init containers first. Any container whose cpu or memory request differs from its limit makes the Pod Burstable at once. A container that sets cpu but not memory is Burstable too. Two containers that are each consistent but different (one with nothing set, one fully set) also give Burstable.

When `spec.resources` sets a pod-level cpu or memory value (the PodLevelResources feature, beta since v1.34), those pod-level values alone decide the class. A pod-level limit without a pod-level request takes its request from the containers' combined request, not from the limit.

Requests also drive autoscaling: the HorizontalPodAutoscaler reads CPU and memory utilization as a percentage of these requests, so a missing or inflated request changes how many replicas it asks for.

[Kubernetes HPA calculator](https://opspane.dev/kubernetes/hpa-calculator/)

## How the Pod request is computed

The scheduler reserves, for each resource, the larger of two numbers, then adds `spec.overhead`:

- **Running Pod**: the sum of the app containers and every sidecar (init container with `restartPolicy: Always`).
- **Busiest init step**: each regular init container, plus the sidecars listed before it, which are already running.

The tool's default manifest has a `migrate` init container, then a `log-shipper` sidecar, then the `app`:

| Phase | CPU | Memory |
| --- | --- | --- |
| Init `migrate` (no sidecar started yet) | **500m** | **512Mi** |
| Sidecar `log-shipper` starts | 100m | 64Mi |
| Running: `app` + `log-shipper` | 350m | 320Mi |
| **Pod request** | **500m** | **512Mi** |

The init step wins on both resources, so this Pod needs 500m and 512Mi free on a node to be scheduled, although it runs on 350m and 320Mi. On a node with 3920m CPU and 14Gi allocatable that is 7 Pods by CPU and 28 by memory, so CPU runs out first.

Limits add up the same way, with one rule of their own: the Pod gets a cpu or memory limit only if every container sets one. Here `migrate` sets no cpu limit, so the Pod's cpu limit is none; its memory limit is 640Mi (512Mi + 128Mi while both run).

How many Pods a node can hold is also capped by its Pod limit; on EKS, by the node's network interfaces.

[EKS max Pods per node](https://opspane.dev/kubernetes/eks-max-pods/)

## Eviction and the OOM killer

Two different things remove Pods when a node runs short of memory, and the class matters to each in a different way.

### Kubelet eviction (node pressure)

When available memory falls below an eviction threshold, the kubelet ranks Pods by, in order: whether their usage exceeds their request, their Pod priority, and how far usage exceeds the request. The class is not a sort key, but it decides the first one in practice: BestEffort Pods request nothing, so they always exceed it; Burstable Pods exceed it once they grow past their request; a Guaranteed Pod cannot use more than its limit, which equals its request.

### Kernel OOM killer

If memory runs out before the kubelet acts, the kernel kills the process with the highest OOM score: roughly its share of memory in thousandths, plus the `oom_score_adj` the kubelet set for its container: −997 for Guaranteed, 1000 for BestEffort, and for Burstable `1000 − 1000 × request ÷ capacity`. In the example on a 16Gi node, `app` gets 985, `migrate` 969, and the sidecar `log-shipper` 985: a sidecar never scores above the smallest app container, so it is not killed before the app it serves.

The kubelet keeps a Burstable score between 3 and 999. The eviction page of the Kubernetes documentation writes the formula as `min(max(2, …), 999)`; the kubelet code clamps to `1000 + (−997)` = 3, so a container requesting all of the node's memory gets 3, which is what this tool shows.

A container that exceeds its own memory limit is OOM-killed by its cgroup regardless of class. CronJob Pods follow the same rules; their template is read from `jobTemplate`.

[Kubernetes CronJob generator](https://opspane.dev/cron/kubernetes/)

## Verification

The engine is a line-by-line port of the Kubernetes source (master branch, read in November 2026). Its unit tests use the vectors from the upstream tests:

- **Defaulting**: `SetDefaults_Pod` and `defaultPodRequests` in `pkg/apis/core/v1/defaults.go`: a limit without a request becomes the request.
- **QoS class**: `ComputePodQOS`, `requirementsQOS` and `resourceQOS` in `pkg/apis/core/helper/qos/qos.go`, with PodLevelResources on. Vectors from `pkg/apis/core/v1/helper/qos/qos_test.go`.
- **Pod request and limit**: `PodRequests`, `PodLimits`, `aggregateContainerResourcesByFn` and `omitPartiallySetCPUMemLimits` in `k8s.io/component-helpers/resource/helpers.go`, from the spec only (no in-place resize status, no DRA). Vectors from its `helpers_test.go`.
- **oom_score_adj**: `GetContainerOOMScoreAdjust` in `pkg/kubelet/qos/policy.go` and `helpers.go`, including the sidecar and pod-level rules. Vectors from `policy_test.go`. A Pod with `priorityClassName: system-node-critical` scores −997.
- **Eviction order**: `rankMemoryPressure` in `pkg/kubelet/eviction/helpers.go`.
- **Quantities**: the same engine as the resource units converter, a port of `resource.Quantity` from `k8s.io/apimachinery`; values are exact integers, so no floating-point error reaches a result.

Not modelled: LimitRange defaults and ResourceQuota (they live in the cluster, not the manifest), the scheduler's scoring defaults for Pods without requests, hugepages and extended resources such as GPUs.

[qos.go](https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/core/helper/qos/qos.go) [component-helpers resource/helpers.go](https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/component-helpers/resource/helpers.go) [kubelet qos/policy.go](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/qos/policy.go) [core/v1 defaults.go](https://github.com/kubernetes/kubernetes/blob/master/pkg/apis/core/v1/defaults.go) [kubelet eviction/helpers.go](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/eviction/helpers.go)

The engine runs in this tab; nothing you paste is sent anywhere.

## FAQ

### Why is my Pod Burstable when every container has requests and limits?

Guaranteed needs each request to equal its limit for both cpu and memory, in every container including init containers and sidecars. A single mismatch is enough: for a container with cpu 250m/500m and memory 1Gi/1Gi this tool reports "container app has cpu request 250m ≠ limit 500m."

### Does a limit without a request make a Pod Guaranteed?

Yes. When a container sets a limit but no request, the API server copies the limit into the request before anything else sees the Pod. A Pod with only limits of cpu 2 and memory 4Gi is Guaranteed, and kubectl get shows requests of 2 and 4Gi.

### How do init containers change the Pod's resource request?

Init containers run one at a time before the app starts, so the scheduler takes, per resource, the larger of the running Pod and the busiest init step. In the example on this page the running Pod asks for 350m CPU and 320Mi, but the migrate init container asks for 500m and 512Mi, so the Pod request is 500m CPU and 512Mi.

### Do sidecar containers count toward the Pod request?

Yes, twice over. A native sidecar (an init container with restartPolicy: Always) keeps running, so it is added to the app containers (350m CPU in the example: 250m + 100m), and it also runs beside every init container listed after it.

### What oom_score_adj does a Burstable container get?

1000 − 1000 × memory request ÷ node memory capacity, rounded down and kept between 3 and 999. A 1Gi request on a 16Gi node gives 938. Guaranteed containers get −997 and BestEffort ones 1000, so the kernel kills BestEffort processes first when the whole node runs out of memory.

### Does the QoS class decide which Pods are evicted first?

Not directly. Under node memory pressure the kubelet ranks Pods by whether their usage exceeds their request, then by Pod priority, then by how far usage exceeds the request. BestEffort Pods request nothing, so any usage puts them first; a Guaranteed Pod using no more than its request comes last.

### Why does my Pod have no CPU limit when most containers set one?

The Pod-level cpu or memory limit exists only when every container, init and sidecar ones included, sets that limit. In the example, migrate sets no cpu limit, so the Pod's cpu limit is none while its memory limit is 640Mi.

## Related tools

- [Kubernetes Resource Units Converter](https://opspane.dev/kubernetes/resource-units/): Convert Kubernetes CPU and memory quantities: millicores, Mi vs M, the form kubectl shows, and the mistakes that break a limit.
- [EKS Max Pods Calculator](https://opspane.dev/kubernetes/eks-max-pods/): Calculate max pods per node for every EC2 instance type, with prefix delegation and the IP addresses your pod CIDR must hold.
- [Kubernetes CronJob Generator](https://opspane.dev/cron/kubernetes/): Generate a complete CronJob manifest with schedule, timeZone, concurrencyPolicy and history limits, explained field by field.
- [Kubernetes HPA Calculator](https://opspane.dev/kubernetes/hpa-calculator/): How many replicas will the HPA ask for, and why? The controller's exact math: tolerance, missing and unready pods, several metrics and behavior.
- [Kubernetes Pod & Service CIDR Planner](https://opspane.dev/kubernetes/pod-cidr/): Max nodes and Pods per node from --node-cidr-mask-size, Service CIDR limits, kube-dns IP and overlaps for IPv4, IPv6 and dual-stack clusters.
