feat: in-place resize of workspace resources on running sandboxes#487
feat: in-place resize of workspace resources on running sandboxes#487noeljackson wants to merge 3 commits intokubernetes-sigs:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: noeljackson The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @noeljackson. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
✅ Deploy Preview for agent-sandbox ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
When SandboxClaim.spec.workspaceResources is updated on a claim with an
existing running sandbox, the controller now patches the pod's container
resources in-place. On Kubernetes 1.27+ with InPlacePodVerticalScaling,
this triggers the kubelet to call UpdateContainerResources on the
container runtime, resizing the workload without restart.
Previously, resource changes on existing claims were silently ignored
('sandbox already exists, skipping update').
a948568 to
b6fb6a9
Compare
|
Folded into #459. The in-place resize logic is now part of the workspace-resources PR so the feature is complete in one PR (creation, warm pool adoption, and runtime resource updates all work). |
Summary
SandboxClaim.spec.workspaceResourcesis updated on a claim with an existing running sandbox, the controller now patches the pod's container resources in-placeWhy
Today updating workspaceResources on a live SandboxClaim has no effect. Users must delete and recreate the claim to change resource allocation, which restarts the workload and loses in-memory state.
Kubernetes 1.27 introduced InPlacePodVerticalScaling (GA in 1.33) which allows patching pod resources without restart. This change makes the SandboxClaim controller use that path so resource changes take effect immediately on running sandboxes.
Changes
reconcileWorkspaceResources()added to the existing-sandbox reconcile path. Compares the claim's workspaceResources with the pod's current container resources and patches them if they differbuildResizePatch()helper builds the resource diff. Only CPU and memory are compared. DiskGB (ephemeral storage) is excluded because it cannot be resized in-placeDepends on
Test plan