Roll back a rollout
Stop a rollout in progress and send all traffic back to the stable Deployment.
Prerequisites
Section titled “Prerequisites”- An
AgentRuntimewith an activespec.rollout. See the progressive rollouts tutorial for one. kubectlaccess to the agent’s namespace.
Roll back by hand
Section titled “Roll back by hand”-
Check what the rollout is doing:
Terminal window kubectl get agentruntime my-assistant -n default \-o jsonpath='{.status.rollout.message}{"\n"}' -
Remove the candidate:
Terminal window kubectl patch agentruntime my-assistant -n default --type merge \-p '{"spec":{"rollout":{"candidate":null}}}'With no candidate, the controller treats the rollout as idle. It deletes the candidate Deployment (
my-assistant-canary) and, whentrafficRoutingis configured, resets traffic to 100% stable.
Roll back automatically
Section titled “Roll back automatically”Set rollout.rollback.mode to automatic. The controller then rolls back without you in two cases:
- An
analysisstep fails. - The candidate Deployment exceeds its progress deadline (
ProgressDeadlineExceeded), for example on an image pull error or a crash loop.
spec: rollout: rollback: mode: automatic progressDeadlineSeconds: 120 # optional, minimum 10; Kubernetes defaults to 600An automatic rollback reverts rollout.candidate to match the current spec and deletes the candidate Deployment. When trafficRouting is configured, it also resets traffic to 100% stable.
With manual (the default) or disabled, a failed analysis leaves the rollout on that step with RolloutActive True and reason AnalysisFailed. Roll back by hand as above. The controller sets no timed requeue, but the status write that records the failure triggers a reconcile that re-runs the analysis from zero, so a metric that has recovered can pass and let the rollout continue.
Verify
Section titled “Verify”-
Check that the candidate Deployment is gone:
Terminal window kubectl get deployment -n defaultmy-assistant-canaryis not listed. -
Check the
RolloutActivecondition:Terminal window kubectl get agentruntime my-assistant -n default \-o jsonpath='{.status.conditions[?(@.type=="RolloutActive")].reason}{"\n"}'The output is
NoActiveRollout. -
After an automatic rollback, find the event that recorded why:
Terminal window kubectl get events -n default \--field-selector involvedObject.name=my-assistant,reason=RolloutRolledBack