An empty resources block silently downgrades pods to BestEffort on Kubernetes 1.34 to 1.36
On Kubernetes 1.34 through 1.36, an empty `resources: {}` block at pod level flips the QoS class to BestEffort even when every container declares requests and limits, and GitLab Runner’s Kubernetes executor emitted that block by default up to 19.4.3. Check your clusters and move GitLab Runner to 19.5.0 or later.
November 2025. Issue #135082 is opened on the Kubernetes repository: an empty resources: {} block at pod level is treated differently from a missing one. 15 July 2026. Fix PR #137150 lands for 1.37, with no backport. 4 November 2026. A DevOps Daily team publishes the measurements showing the real impact on a k3s cluster. Why it matters: your pods can be classified BestEffort and throttled or rejected without anyone changing a single request — and GitLab Runner was emitting that block by default.
An empty block is not a missing block
The flaw rests on a distinction that almost everywhere else in Kubernetes ignores. The PodLevelResources feature gate — resources declared at pod level rather than per container — went alpha in 1.32 and beta, on by default, in 1.34, as part of KEP-2837. With the gate on, the QoS class calculation takes a shortcut in ComputePodQOS: if the gate is enabled and pod.Spec.Resources is non-nil, the function derives the class from the pod’s resources.
An empty resources: {} block is not nil. It holds no requests and no limits, so the function returns BestEffort — and the loop over the containers never runs. The helper IsPodLevelResourcesSet, meanwhile, treats {} as “not set”. That divergence between the two readings is the bug, present in v1.34.0, v1.35.0, and v1.36.0, and still there in the v1.34.13, v1.35.10, and v1.36.6 patches released on 27 October 2026.
Measurable consequences, not theoretical ones
The team ran the same pods on k3s v1.34.12, v1.35.9, v1.36.5, and v1.37.1, with cgroup v2 and a hard eviction threshold of memory.available<2Gi. The results are unambiguous.
The kubelet classifies pods carrying the empty block as BestEffort, while their identical controls keep Burstable or Guaranteed. The oom_score_adj jumps to 1000 — the highest value the kernel accepts — versus 935 for a Burstable pod and -997 for a Guaranteed one. The pod moves into the kubepods-besteffort.slice slice with a cpu.weight of 1 and no pod-level memory.max, even though the container limits stay in place.
The most telling consequence is CPU. Next to a neighbour saturating both vCPUs, a pod that requested 0.5 CPU got only 0.061 to 0.083 cores, versus 0.573 to 0.580 without the empty block — that is 10.6% to 14.3% of its request. A ResourceQuota with scope BestEffort and pods: "0" rejects the pod on 1.34 to 1.36 and admits it on 1.37. On v1.37.1, the classes are correct again.
A myth worth correcting along the way
The study also corrects a widespread belief. Contrary to the folk wisdom that these pods are “evicted first”, the kubelet’s eviction order under memory pressure did not change. The ranking compares memory usage against the declared request — and for an empty block, that request still comes from the containers. The QoS class is not part of the ranking. Across all four versions, in all twelve repetitions, the eviction order stayed identical.
That is a useful reminder: the QoS class governs oom_score_adj and cgroup placement, not the kubelet’s memory reclamation order. The bug’s danger is not “early eviction” — it is silent CPU throttling and quota rejection.
The concrete source: GitLab Runner
The bug would stay a curiosity if you had to write the empty block by hand. GitLab Runner wrote it for you. Its Kubernetes executor added pod-level resources in 18.10.0 (MR 5922): the podResourcesReference() helper returns a non-nil object, and if none of pod_cpu_request, pod_memory_request, pod_cpu_limit, or pod_memory_limit is configured, both maps stay empty — so the pod heads to the API server with resources: {}.
Fix MR 7346, merged on 1 October 2026 and shipped in 19.5.0, states it in plain terms: job pods “were showing qosClass: BestEffort instead of the expected Burstable”, and after the fix .spec.resources is absent rather than {}. The 19.3.5 and 19.4.3 tags of 28 October 2026 still carried the old function.
# Ten-second detection: any pod carrying requests/limits but classified
# BestEffort is a candidate for the bug.
kubectl get pods -A -o custom-columns=NS:.metadata.namespace,POD:.metadata.name,QOS:.status.qosClass \
| grep BestEffort
# Check the executor version:
gitlab-runner --version The verdict
If you run GitLab Runner on Kubernetes, upgrade to 19.5.0 or later — that is the most direct fix, and the 19.3.5 and 19.4.3 tags are still affected. If you operate a cluster on 1.34, 1.35, or 1.36, run the detection above and treat every BestEffort pod carrying requests as a class false positive, because the fix is not backported and the latest patches dated 27 October 2026 remain vulnerable. If you relied on the QoS class to prioritize eviction, fix your mental model along the way — the kubelet’s eviction order depends on usage relative to the request, not on the class. The bug is a good reminder that what counts is not what you think you declared, but what the kubelet actually classified.