Repository navigation
ateworker: report ready only after sandbox runtimes are registered - #3414
Draft
shrutiyam-glitch wants to merge 2 commits into
Draft
shrutiyam-glitch wants to merge 2 commits into
shrutiyam-glitch wants to merge 2 commits into
Conversation
run stored the worker epoch as soon as RegisterWorker returned, before reconciler.sync read sandbox-runtimes.json and called SetWorkerSandboxRuntimes. When atelet had not written sandbox-runtimes.json yet or SetWorkerSandboxRuntimes failed, Epoch.Registered still returned nil, so /readyz served 200 OK and the Worker moved to WORKER_STATE_ACTIVE with no SandboxClasses recorded on the control plane. Store the epoch in the SetWorkerSandboxRuntimes callback after the first report succeeds. Epoch.Registered and Epoch.Require then hold the pod unready and refuse workloads with Unavailable until the control plane holds both capacity and sandbox runtimes. Signed-off-by: Shrutiya <shrutiyam@google.com>
Signed-off-by: Shrutiya <shrutiyam@google.com>
This branch has not been deployed
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.
Fixes #3276
register.Reportstored the worker epoch immediately afterRegisterWorkerreturned, beforereconciler.syncreadsandbox-runtimes.jsonand reported runtimes viaSetWorkerSandboxRuntimes. Whenateletcould not writesandbox-runtimes.json(for example, when aSandboxConfigversion failed to sync),/readyzstill returned200 OK, Kubernetes marked the PodReady, andate-controllermarked theWorkerWORKER_STATE_ACTIVEeven thoughscheduling.Registeredtreated theWorkeras unregistered (SandboxClassesempty). During a Deployment rollout, the new replica counted as available before it had a usable runtime, allowing Kubernetes to terminate healthy old replicas.Store the registered epoch inside the
SetWorkerSandboxRuntimeswrapper inrunafter the RPC succeeds soEpoch.RegisteredandEpoch.Requirestay unready until the control plane holds both the worker's capacity and its sandbox runtimes.AI-assisted, I reviewed and tested it.