Skip to content

Conversation

@antonipp
Copy link
Contributor

@antonipp antonipp commented Nov 27, 2025

Description

While trying out the agent-sandbox project, I noticed that the main controller is deployed as a StatefulSet. I couldn't really find a justification for it in the commit history, so this looks like an oversight. The controller is stateless and doesn't require a stable network identity, so I don't really see a reason to use a much heavier abstraction here. Moreover, STS ordered rollout semantics are unnecessary for a stateless controller and could complicate scaling/updates if leader election is enabled for HA.

So my PR switches the controller to be deployed as a simple Deployment, I think it will make operations easier for everyone

Migration Guide

The controller changed from StatefulSet to Deployment and leader election is now enabled by default. Before you deploy the new charts, you need to clean-up the existing StatefulSet (this will cause a brief disruption to Sandbox state reconciliation):

kubectl delete statefulset agent-sandbox-controller -n agent-sandbox-system

Then deploy the new charts. Verify that the Deployment has been properly created:

kubectl get deployment agent-sandbox-controller -n agent-sandbox-system

If needed, the rollback steps are:

kubectl delete deployment agent-sandbox-controller -n agent-sandbox-system
kubectl apply -f <previous-version-manifest.yaml>

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: antonipp
Once this PR has been reviewed and has the lgtm label, please assign justinsb for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 27, 2025
@netlify
Copy link

netlify bot commented Nov 27, 2025

Deploy Preview for agent-sandbox canceled.

Name Link
🔨 Latest commit 8fbc2d5
🔍 Latest deploy log https://app.netlify.com/projects/agent-sandbox/deploys/6957cd3855abca00088a2f7a

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 27, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @antonipp. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 27, 2025
@janetkuo
Copy link
Member

janetkuo commented Dec 2, 2025

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Dec 2, 2025
@barney-s
Copy link
Contributor

barney-s commented Dec 2, 2025

This is an acceptable change. We can switch back to sts later if needed. Would you check the docs and check if they need a change.

Copy link
Contributor

@barney-s barney-s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes

---

kind: StatefulSet
kind: Deployment
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While changing the kind to Deployment is the correct move for a stateless controller, this is a breaking change for existing users. An upgrade will not be smooth as the new Deployment won't manage the old StatefulSet's pods.

Please add a note to the RELEASE.md or a dedicated upgrade guide explaining the manual steps required, which likely involve deleting the old StatefulSet before applying the new manifests.

Copy link
Contributor Author

@antonipp antonipp Dec 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am aware it's a breaking change but not really sure what's the actual process for documenting it should be. RELEASE.md feels wrong and an upgrade guide is overkill for such as simple change (especially since the project is in the early days and users should expect the internals to change)

Maybe something we just call out in the Github release notes somehow?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antonipp Would you document the migration step in the PR description?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, added a short migration guide to the PR description

@antonipp antonipp force-pushed the ai/sts-to-deployment branch from aa548c2 to 1571613 Compare December 3, 2025 12:27
@antonipp
Copy link
Contributor Author

antonipp commented Dec 3, 2025

/retest

@janetkuo
Copy link
Member

/label release-note-action-required

@k8s-ci-robot
Copy link
Contributor

@janetkuo: The label(s) /label release-note-action-required cannot be applied. These labels are supported: api-review, tide/merge-method-merge, tide/merge-method-rebase, tide/merge-method-squash, team/katacoda, refactor, ci-short, ci-extended, ci-full. Is this label configured under labels -> additional_labels or labels -> restricted_labels in plugin.yaml?

Details

In response to this:

/label release-note-action-required

Instructions 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.

@janetkuo janetkuo added the release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. label Dec 23, 2025
---

kind: StatefulSet
kind: Deployment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antonipp Would you document the migration step in the PR description?

Signed-off-by: Anton Ippolitov <anton.ippolitov@datadoghq.com>
@antonipp antonipp force-pushed the ai/sts-to-deployment branch from db992f2 to 8fbc2d5 Compare January 2, 2026 13:50
@k8s-ci-robot
Copy link
Contributor

@antonipp: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
presubmit-agent-sandbox-e2e-test 8fbc2d5 link true /test presubmit-agent-sandbox-e2e-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Details

Instructions 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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-action-required Denotes a PR that introduces potentially breaking changes that require user action. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants