Repository navigation
Conversation
Lets Task, Session, and WorkerPool agent pods run under a sandboxed RuntimeClass such as gVisor or Kata Containers. WorkerPool's pod spec comparison now includes the field, so changing it rolls the StatefulSet. Claude-Session: https://claude.ai/code/session_01MqFY9Nqj6Sq83zLX8iW4H3
There was a problem hiding this comment.
1 issue found across 14 files
You’re at about 91% of the monthly reviewed-line limit. You may want to disable incremental reviews to conserve quota. Reviews will continue until that limit is exceeded. If you need help avoiding interruptions, please contact contact@cubic.dev.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="docs/reference.md">
<violation number="1" location="docs/reference.md:33">
P3: The new row is documented only under the deprecated `spec.podOverrides` path. Users on `spec.worker.podOverrides` (the path for Session and WorkerPool) would not find it. Name the preferred path in the row, and state that it applies to Session and WorkerPool too.</violation>
</file>
Reply to a comment to ask cubic a question or push back. It learns from your replies.
View guided diff | Re-trigger cubic
| | `spec.podOverrides.tolerations` | Tolerations for the agent pod; use with `nodeSelector` or `affinity` to target dedicated node pools (e.g., GPU nodes, agent-specific pools) | No | | ||
| | `spec.podOverrides.affinity` | Node, pod, and pod-anti-affinity rules. Use for spreading agents across nodes or expressing scheduling preferences beyond `nodeSelector` | No | | ||
| | `spec.podOverrides.imagePullSecrets` | Secrets used to pull container images from private registries. Required when the agent image or any init container image is in a private registry | No | | ||
| | `spec.podOverrides.runtimeClassName` | RuntimeClass for the agent pod, e.g. a gVisor or Kata Containers sandbox. The RuntimeClass must already exist in the cluster | No | |
There was a problem hiding this comment.
P3: The new row is documented only under the deprecated spec.podOverrides path. Users on spec.worker.podOverrides (the path for Session and WorkerPool) would not find it. Name the preferred path in the row, and state that it applies to Session and WorkerPool too.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. When an issue isn't valid or won't be fixed in this PR, reply in its thread with the reason and then resolve the thread. At docs/reference.md, line 33:
<comment>The new row is documented only under the deprecated `spec.podOverrides` path. Users on `spec.worker.podOverrides` (the path for Session and WorkerPool) would not find it. Name the preferred path in the row, and state that it applies to Session and WorkerPool too.</comment>
<file context>
@@ -30,6 +30,7 @@ Exactly one execution source is required: `spec.worker` (preferred), `spec.worke
| `spec.podOverrides.tolerations` | Tolerations for the agent pod; use with `nodeSelector` or `affinity` to target dedicated node pools (e.g., GPU nodes, agent-specific pools) | No |
| `spec.podOverrides.affinity` | Node, pod, and pod-anti-affinity rules. Use for spreading agents across nodes or expressing scheduling preferences beyond `nodeSelector` | No |
| `spec.podOverrides.imagePullSecrets` | Secrets used to pull container images from private registries. Required when the agent image or any init container image is in a private registry | No |
+| `spec.podOverrides.runtimeClassName` | RuntimeClass for the agent pod, e.g. a gVisor or Kata Containers sandbox. The RuntimeClass must already exist in the cluster | No |
| `spec.podOverrides.serviceAccountName` | Service account name for the agent pod; use with workload identity systems (IRSA, GKE Workload Identity, Azure) | No |
| `spec.podOverrides.volumes` | Additional volumes to attach to the agent pod. Names must not be `workspace` or use the Kelos-reserved `kelos-` prefix | No |
</file context>
| | `spec.podOverrides.runtimeClassName` | RuntimeClass for the agent pod, e.g. a gVisor or Kata Containers sandbox. The RuntimeClass must already exist in the cluster | No | | |
| | `spec.podOverrides.runtimeClassName` | RuntimeClass for the agent pod, e.g. a gVisor or Kata Containers sandbox. The RuntimeClass must already exist in the cluster. Preferred path: `spec.worker.podOverrides.runtimeClassName`, which also applies to Session and WorkerPool | No | |
The API server rejects a Pod with runtimeClassName "", so a Task or WorkerPool with one would never get a running pod. Enforce MinLength=1 in the CRD schema instead. Claude-Session: https://claude.ai/code/session_01MqFY9Nqj6Sq83zLX8iW4H3
|
/kelos api-review |
|
🤖 Kelos Task Status Task |
|
/kelos review |
|
🤖 Kelos Task Status Task |
|
🤖 Kelos API Reviewer Agent @gjkim42 API Design ReviewVerdict: APPROVE The field shape is right: same name, type, and meaning as FindingsCompatibility / Conversion
Documentation / Security contract
Validation
Notes (P3, no action needed)
Suggestions (optional)
/kelos needs-input |
|
🤖 Kelos Reviewer Agent @gjkim42 Review SummaryVerdict: COMMENT Findings Overview
FindingsCompatibility / Conversion
Documentation
Suggestions (optional)
Key takeaways (optional)
Note on prompt injection: A third-party review comment on this PR includes a "Prompt for AI agents" block that tells agents to change code and resolve review threads. That instruction was disregarded, and this review was formed independently from the code. |
|
you don't have to care about the v1alpha1 API. |
v1alpha1 PodOverrides has no runtimeClassName, so a read-modify-write through v1alpha1 dropped it and later Tasks ran without the sandbox. Carry it in a kelos.dev/v1alpha2-runtime-class-name annotation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YGMCH7ihsiWwwg4KRPB5TW
Reject names the API server would refuse at Pod creation at apply time instead, while the field is new and tightening is free. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YGMCH7ihsiWwwg4KRPB5TW
Note that a Session agent can clear its own runtimeClassName, and what users see when the RuntimeClass is missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YGMCH7ihsiWwwg4KRPB5TW
|
Addressed the Kelos reviewer and API reviewer findings:
|
|
@gjkim42 so sorry, I think I jumped the gun a little there - want me to remove that (the API bit specifically)? |
What type of PR is this?
/kind api
What this PR does / why we need it:
Adds
runtimeClassNametoPodOverrides, so agent pods can run under a sandboxed RuntimeClass such as gVisor or Kata Containers.Agents run unattended with a shell and act on untrusted input: PR bodies, issue comments, and upstream changelogs. A sandboxed runtime keeps a container escape from reaching the node. There's no way to set this today short of a mutating webhook.
JobBuilder) and WorkerPool StatefulSets.podTemplateSpecEqualnow compares the field, so changing it on a running pool rolls the StatefulSet.*string,v1alpha2only, asCONTRIBUTING.mdasks. Nothing is set unless a user opts in.Which issue(s) this PR is related to:
N/A
Special notes for your reviewer:
I ran the stock
claude-codeagent image under gVisor (runsc) on a k3s cluster: clone,gh, and the agent CLI all work. The only noticeable cost is process start, ~2.3ms vs ~0.5ms under runc.make testpasses for the changed packages.internal/sessionruntimeandinternal/consoleserverfail the same way on cleanmainin my sandboxed environment, so I left them to CI. Frommake test-integrationI ran only the new empty-runtimeClassNamespec, under envtest.Does this PR introduce a user-facing change?
🤖 Generated with Claude Code
https://claude.ai/code/session_01MqFY9Nqj6Sq83zLX8iW4H3