feat(api-rs): pin sandbox pods via SESSION_SANDBOX_NODE_SELECTOR / _TOLERATIONS#3
Open
mo4islona wants to merge 2 commits into
Open
feat(api-rs): pin sandbox pods via SESSION_SANDBOX_NODE_SELECTOR / _TOLERATIONS#3mo4islona wants to merge 2 commits into
mo4islona wants to merge 2 commits into
Conversation
…OLERATIONS api-rs inlines the sandbox pod template when it creates the agents.x-k8s.io Sandbox, so the pod previously had no nodeSelector/tolerations and could not be confined to a specific node pool (e.g. a cost-saving spot pool). Add two optional knobs, mirroring the existing SESSION_SANDBOX_* env family: - SESSION_SANDBOX_NODE_SELECTOR key=value[,key=value...] -> pod nodeSelector - SESSION_SANDBOX_TOLERATIONS JSON array of toleration objects -> pod tolerations Both default to empty, so the rendered pod is unchanged when unset. Wired through AgentSandboxConfig into the pod spec via the same insert_optional path used for imagePullSecrets. Unit tests cover arg parsing and that the fields land on (and stay absent from) the built Sandbox pod template. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…lection The per-sandbox iron-proxy pod was built with no nodeSelector/tolerations, so with sandboxes pinned to a tainted pool the proxy pods spilled onto general nodes. Carry the sandbox node_selector/tolerations into IronProxyConfig and set them on the proxy PodSpec, so the proxy follows its sandbox onto the same pool. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two new optional env knobs on api-rs that set the
nodeSelectorandtolerationsof every agent sandbox pod:SESSION_SANDBOX_NODE_SELECTOR—key=value[,key=value...]SESSION_SANDBOX_TOLERATIONS— JSON array of toleration objects, e.g.[{"key":"centaur","operator":"Equal","value":"true","effect":"NoSchedule"}]Why
api-rs inlines the sandbox pod template when it creates the
agents.x-k8s.ioSandbox(it does not go throughSandboxTemplate/SandboxClaim). So the sandbox pod had no scheduling fields and could not be confined to a specific node pool — e.g. a dedicated spot pool for cost isolation. The control-plane pods can already be pinned via the Helm chart (nodeSelector/tolerationsvalues); this closes the gap for the sandbox runtime pods, which are the heavy/bursty workload.How
AgentSandboxConfiggainsnode_selector: BTreeMap<String,String>andtolerations: Vec<Value>.insert_optionalpath already used forimagePullSecrets, so empty = field omitted (rendered pod unchanged when unset).TryFrom<&SandboxArgs>; invalid toleration JSON fails fast withUnsupportedConfig.Wiring (no chart change needed)
These are plain env vars, so they can be set through the existing
apiRs.extraEnvHelm value — no template change required:Tests
agent_k8s_config_converts_from_sandbox_argsextended: parseskey=valueselector pairs (trimmed) and the tolerations JSON.node_selector_and_tolerations_land_on_the_pod: asserts both land on the builtSandboxpod template, and are absent by default.Companion to the chart-side scheduling PR (control-plane
nodeSelector/tolerations).🤖 Generated with Claude Code