-
Notifications
You must be signed in to change notification settings - Fork 78
Allow sandbox claim to specify whether to get pod from sandbox warm pool #212
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: PersistentJZH <zhihao.kan17@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: PersistentJZH 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 |
✅ Deploy Preview for agent-sandbox canceled.
|
|
Welcome @PersistentJZH! |
|
Hi @PersistentJZH. 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 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. |
|
/cc @peterzhongyi |
|
@PersistentJZH: GitHub didn't allow me to request PR reviews from the following users: peterzhongyi. Note that only kubernetes-sigs members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn response to this:
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. |
|
/ok-to-test |
|
(BTW, |
peterzhongyi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
|
@peterzhongyi: changing LGTM is restricted to collaborators DetailsIn response to this:
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. |
|
Not seeing much discussion, why is this case needed? If there is a use case, cann't user create sandbox directly? |
This field is used in scenarios where a user wants to use a template but doesn't want to fetch a pod from the warm pool, add this field can make SandboxClaims more flexible. @peterzhongyi , or do you have more cases about this? |
+1 to this. Why is this a requirement ? |
barney-s
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wondering if we have only one warm pool per template ?
If we plan to have multiple warm pools then redoing this change to something like this would be better:
.spec.warmpool=default|none
This is a breaking change but clearly indicates dont use a warmpool OR use the default warmpool and allows adding additional warmpools in future.
I have a few comments regarding the test variable naming, and verifying the protobuf tags.
| createWarmPoolPod("pool-pod-1", metav1.Now()), | ||
| } | ||
|
|
||
| client := fake.NewClientBuilder(). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The variable name client here shadows the package name client (likely from sigs.k8s.io/controller-runtime/pkg/client) which is used in []client.Object just a few lines above.
Consider renaming this variable to fakeClient or k8sClient to avoid confusion and potential compilation issues if the package client is needed later in the scope.
| // SkipWarmPool, when set to true, prevents the controller from attempting | ||
| // to adopt a pre-warmed pod from a SandboxWarmPool. Instead, a new pod will always be created fresh. | ||
| // +optional | ||
| SkipWarmPool *bool `json:"skipWarmPool,omitempty" protobuf:"varint,4,opt,name=skipWarmPool"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need the protobuf ID ?
|
|
||
| // Pool labels should still be present since the pod was not adopted | ||
| if _, exists := poolPod.Labels[poolLabel]; !exists { | ||
| t.Error("expected pool label to still be present on pod (not adopted)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: For better debugging if this test fails, consider including the actual labels found in the error message, e.g., t.Errorf("expected pool label to still be present, but got labels: %v", poolPod.Labels).
They can, but it's mainly for the ease-of-use aspect of the Sandbox Claim CRD. It's kind of messy for a user to go back to creating sandboxes when they want to avoid warm pool. Ideally, when a user starts using Sandbox Claim, it would be nice for the user to perform most of the things on this level of CRD. |
The use case is for when a user wants a sandbox that is not a fresh image, but a pod snapshot that stored some previous state of the user's work. Since a snapshot is restored at the creation of the pod, we can't just give the user a pod from the warm pool anymore because those pods are all using fresh images. |
Why a claim though ? What is restored from a snapshot ? Would the pod spec be restored from snapshot ? |
This can help simplify the way customer uses agent sandbox. Ideally, a customer should be able to just create claims and get sandboxes created or resumed. The memory of the workload is restored from a snapshot. The pod spec wouldn't be restored from snapshot, the pod spec is needed for the snapshot restoration, and the pod spec is provided by the sandbox template. I have some more details about this feature in this issue: #208 |
|
PR needs rebase. 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. |
Summary
Related Issues
#208