Skip to content
Install the CLI

Reference CLI

rollback

These docs describe Kix's main branch, which can include changes not yet released. Read the docs for the latest release.

kix rollback switches a cluster back to one of its Superseded activations. It does not build: it finds the target activation’s build in Kix’s local store and applies it through the same engine as kix deploy. To see the activations it can roll back to, run kix history.

This page is hand-maintained. Check cli/kix-cli/src/cli.rs and cli/kix-cli/src/commands/rollback.rs when in doubt.

kix rollback <CLUSTER> [-y] [--dry-run] [--prune] [--force-conflicts] [--accept-migrations] [--operator] [--flake <FLAKE>] [--context <CONTEXT>]
Argument or flagMeaning
<CLUSTER>Cluster name, as recorded on its Activation records.
-y, --yesRoll back to the most recent Superseded activation without prompting.
--dry-runPrint the plan and stop.
--pruneDelete resources the current activation has and the target does not, and orphans earlier deploys kept. Without it they are listed and kept, and the target Activation records where they came from, as a deploy does.
--force-conflictsTake fields that another field manager owns, such as a replica count set with kubectl scale. Without it, a conflict stops the rollback before it writes anything.
--accept-migrationsProceed when the rollback replaces a resource that holds data in a stateful package, matching kix deploy --accept-migrations. Without it, the rollback stops before changing the cluster, even with -y. Kix does not copy data between the old and new resources.
--operatorAsk the Kix operator to restore the target Activation record as the cluster’s current deployment and mark the previous record Superseded. See Operator mode.
--flake <FLAKE>Flake reference used to evaluate the cluster name when no Activation record in the context carries <CLUSTER>. See Global flags.
--context <CONTEXT>Kubeconfig context. See Global flags.

Only records that were once the cluster’s running state are offered. A deploy that stopped part way is never a target.

On a terminal without --yes, Kix lists the candidates, newest first, and asks for a number; Enter picks the newest. Without a terminal it picks the newest and then stops at the confirmation unless --yes is set.

The target’s build must be in Kix’s local store, found through the record’s source path or the local activation cache. A build made on another machine or removed from the local store cannot be rolled back to from here. How many records exist depends on kix gc retention.

A build from a Kix library before 2026-10-02 cannot be rolled back to if it imports a CRD (scope.mkCRDRef, or kix.mkImport with crds). Its CRD ref markers lack the kix.run/crd-served-versions annotation, and Kix refuses the build before applying anything (with --operator, the operator refuses it). Deploy a fresh build instead.

Before it writes anything, the rollback sends its writes to the apiserver as a dry run, as kix plan does, and sorts the answers by the same rules. When the apiserver would refuse one, such as for a field ownership conflict, Kix lists the refused writes and stops, so the cluster is never left between two builds. An object that kix plan would list as not checked, such as one in a Namespace the rollback creates, does not stop it. --dry-run shows the same list.

If the rollback replaces a resource that holds data in a stateful package (such as a PersistentVolumeClaim renamed between the two builds), it stops with [K3354] before changing the cluster, matching kix deploy. Kix lists each replacement and whether the old resource will be kept as an orphan or deleted. Back up or migrate the data first, then run the rollback again with --accept-migrations.

The rollback waits up to 180 seconds for each resource to become ready and stops at the first failure.

Before reading deployment records (and again after you confirm the plan), kix rollback checks and takes the cluster’s deploy lock just like kix deploy. It stops without changing anything if another active run holds the lock or if another run modified the cluster after the plan was built. Once all resources are applied, Kix records the target deployment as active on ActivationHead in a single write before updating record phases.

❱ kix history demo
❱ kix rollback demo --dry-run
❱ kix rollback demo --yes
CodeMeaning
0Rolled back, nothing to change, or the prompt was declined
1A resource failed, including a failed or timed-out prune delete; confirmation was needed on a non-interactive terminal; no target is available; the target build is not in the local store; another run holds the deploy lock or modified the cluster after the plan was built; or a cluster error