Skip to content

Roll back a rollout

Stop a rollout in progress and send all traffic back to the stable Deployment.

  1. Check what the rollout is doing:

    Terminal window
    kubectl get agentruntime my-assistant -n default \
    -o jsonpath='{.status.rollout.message}{"\n"}'
  2. 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, when trafficRouting is configured, resets traffic to 100% stable.

Set rollout.rollback.mode to automatic. The controller then rolls back without you in two cases:

  • An analysis step 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 600

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

  1. Check that the candidate Deployment is gone:

    Terminal window
    kubectl get deployment -n default

    my-assistant-canary is not listed.

  2. Check the RolloutActive condition:

    Terminal window
    kubectl get agentruntime my-assistant -n default \
    -o jsonpath='{.status.conditions[?(@.type=="RolloutActive")].reason}{"\n"}'

    The output is NoActiveRollout.

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