Skip to content

feat(k8s): set the pod overhead of RuntimeClass gvisor - #5530

Merged
dan-petty merged 3 commits into
mainfrom
feat/5434-set-the-pod-overhead-of-runtimeclass
Nov 13, 2026
Merged

dan-petty merged 3 commits into
mainfrom
feat/5434-set-the-pod-overhead-of-runtimeclass

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

RuntimeClass gvisor now sets overhead.podFixed to memory 16Mi. The measurement of runc against runsc on the labelled node found 15.1 MiB of fixed memory for each pod under runsc. It found no CPU overhead, so the class sets no cpu key. With the overhead, the scheduler, the kubelet and a ResourceQuota count the memory of the sandbox. An invariant test pins the value, and the spec k8s-gvisor-runtime gets a requirement for it.

The measurement also shows that the CPU and memory limits of a pod hold under runsc. k8s/README.md records the result, the overhead and the kernel version that the pinned runsc reports (4.19.0-gvisor).

No workload moves to the class in this change. The first workload is a sandbox entry under #5447 that the owner approves.

Closes #5434

Change: openspec/changes/archive/2026-11-13-5434-set-the-pod-overhead-of-runtimeclass/

The measurement of runc against runsc (#5434) gave 15.1 MiB of fixed
memory for each pod under runsc and no CPU overhead. RuntimeClass
gvisor now sets overhead.podFixed to memory 16Mi and sets no cpu key.
An invariant test pins the value. The header line that kept each
workload off the class until #5434 goes.

k8s/README.md gives the kernel version of the pinned runsc
(4.19.0-gvisor), the measured result of the limits and the overhead.
ASD-STE100 permits at most 25 words in a description sentence. The
README bullet "Overhead", the header comment of the RuntimeClass, the
test docstring, the spec requirement, the proposal and the tasks had
sentences with up to 45 words. Each such sentence is now two or more
sentences. The text keeps the same facts.
@dan-petty dan-petty added type/feature Type feature: a new function scope/k8s Kubernetes commands, Helm charts, pods, services, and policies labels Nov 13, 2026
@dan-petty

Copy link
Copy Markdown
Owner Author

Test results and render diff (head of the branch after the rebase on origin/main)

Test first. On the base, the new test failed as expected: test_the_gvisor_runtime_class_declares_the_measured_pod_overhead: assert None == {'podFixed': {'memory': '16Mi'}}. After the manifest change, it passes.

Scoped checks (all pass):

  • uv run devops ci test tests/invariants/test_k8s_argocd_apps.py tests/invariants/test_k8s_manifests.py tests/docs/test_docs_inventory.py tests/docs/test_docs.py tests/invariants/test_living_specs.py tests/invariants/test_committed_addresses.py tests/commands/k8s/test_k8s_network_policies.py: 258 passed.
  • uv run devops ci --check --only lint,format,domain,docs,k8s,openspec: 7 rows pass.
  • uv run devops ci --check --only typecheck: pass. This change touches no file under src/.
  • uv run openspec validate 5434-set-the-pod-overhead-of-runtimeclass --strict (before the archive): valid. uv run devops openspec check: pass.
  • The pre-commit and pre-push hooks ran on each commit and on the push.

Render diff. kubectl kustomize k8s at origin/main and at the branch: one difference only.

 kind: RuntimeClass
 metadata:
   name: gvisor
+overhead:
+  podFixed:
+    memory: 16Mi
 scheduling:

The handler runsc and the node selector node-restriction.kubernetes.io/gvisor: "true" do not change. No other object changes. No other kustomization includes runtimeclass-gvisor.yaml.

Cluster (read-only).

  • kubectl apply --dry-run=server -f k8s/runtimeclass-gvisor.yaml: runtimeclass.node.k8s.io/gvisor configured (server dry run).
  • The live class has no overhead now. No pod sets runtimeClassName: gvisor (count 0).
  • Restarts: none. Argo CD's base Application changes the cluster-scoped RuntimeClass in place. Admission adds the overhead to a pod only when the pod is created, so no running pod changes. A later pod of the class gets 16Mi more in its scheduling request, its pod cgroup and the quota of its namespace.

Review fix. The review commit splits 11 sentences of more than 25 words (ASD-STE100) in the README, the header comment of the manifest, the test docstring, the spec requirement, the proposal and the tasks. The facts do not change.

Acceptance criteria.

@dan-petty
dan-petty marked this pull request as ready for review November 13, 2026 19:01
@dan-petty
dan-petty merged commit 6eae498 into main Nov 13, 2026
23 checks passed
@dan-petty
dan-petty deleted the feat/5434-set-the-pod-overhead-of-runtimeclass branch November 13, 2026 19:04
dan-petty pushed a commit that referenced this pull request Nov 13, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.132.0](v0.131.0...v0.132.0)
(2026-11-13)


### Features

* **k8s:** set the pod overhead of RuntimeClass gvisor
([#5530](#5530))
([6eae498](6eae498))


### Bug Fixes

* **roadmap:** leave out changed intake candidates and count plan calls
([#5540](#5540))
([d44b9fa](d44b9fa))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: dan-petty-release[bot] <346998822+dan-petty-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope/k8s Kubernetes commands, Helm charts, pods, services, and policies type/feature Type feature: a new function

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(k8s): measure runsc against runc for RuntimeClass gvisor

1 participant