Upgrading
Move to a new Wardn version in the right order, keep operators within the supported skew, and go back if you must.
A Wardn version is one number for everything: the server and web images, the charts, the operator and the CLI all carry the same version. Upgrade the control plane first, then the operators, then the CLI. The control plane accepts operators that are a little behind it, which is what makes that order safe.
Wardn is at 0.x. Until the first stable release, treat every minor version as possibly incompatible: read its release notes, and upgrade the operators together with the control plane.
Before you start
- Read the release notes for every version between yours and the target, in the Changelog and on the release page. Anything that affects operators is listed first.
- Back up the database, and keep the keys (Backup and restore). Migrations only go forward, so this backup is how you go back.
- Verify the new images and charts if your policy asks for it (Verify what you download).
The order
Upgrade the control plane
| Install | Command |
|---|---|
wardn-standard | helm upgrade wardn oci://ghcr.io/future-pirate-king/charts/wardn-standard -n wardn --values values.yaml --version 0.2.0 |
wardn-tiny | helm upgrade wardn oci://ghcr.io/future-pirate-king/charts/wardn-tiny -n wardn --reuse-values --version 0.2.0 |
| Compose | Set the image variables in .env to the new tags, then docker compose pull && docker compose up -d |
The chart's images default to the chart's own version, so a chart upgrade moves the images with it. If you pinned image.server.tag or image.web.tag, change them too.
What happens:
- The first new server replica takes the migration lock and migrates the schema. The other replicas wait for the lock and find nothing left to do.
- In
wardn-standard, replicas roll one at a time, and a new one only takes traffic once/api/v1/readyanswers. The API stays up. - In
wardn-tinyand Compose there is one replica, so the API is unavailable for the moment the new one starts. - The web app's init container brings its sign-in tables up to date before the new web pods start.
- Operators lose their gateway for a moment as replicas restart, and reconnect by themselves. Nothing is lost: they resume from the last batch Wardn acknowledged.
Check that the new version is ready:
kubectl -n wardn rollout status deploy/wardn-wardn-standard-server
kubectl -n wardn exec deploy/wardn-wardn-standard-server -- wget -qO- http://localhost:8080/api/v1/readyUpgrade the operators
Operators do not upgrade themselves. With the new CLI, re-run connect for each cluster against its existing id:
wardn cluster connect --cluster-id <cluster-id> \
--gateway-url https://gateway.example.com:8443 \
--context prod-eu-1The CLI's default operator image is the one of its own version, ghcr.io/future-pirate-king/operator:<cli version>. To choose another, add --image. The command applies the same manifests with the new image. It also makes a new join token; an operator that has already joined keeps its identity and does not need it. The operator's Deployment uses the Recreate strategy, so the old operator stops before the new one starts and there are never two.
If you installed the operator with --namespaces, pass the same list again, or the operator gets cluster-wide read access instead.
Upgrade the CLI
Download the new archive, or pull the new ghcr.io/future-pirate-king/cli image (CLI). Check it with wardn version.
Sign-up now defaults to invite
Installs from before sign-up modes created a Personal organization (slug personal-<id>) for anyone who signed in with none. Those organizations stay as they are and now count as personal organizations, and nobody loses access. Existing accounts keep signing in.
New sign-ups are different: the default is invite, so only people with an invitation can create an account. If your install relied on anyone being able to sign up, set WARDN_SIGNUP=open (Helm: auth.signup: open) to keep that. See Sign-up modes.
Upgrade the web app first
When you upgrade from a version before single sign-on and sign-up modes, roll out the web app before the server. The web app creates the sign-in tables for single sign-on and SCIM when it starts, and the server reads them, so a server that starts first reports /ready as 503 until the web app has run. The Helm chart and Compose do this in order; if you run them by hand, start the new web app first.
The web app and the server must share BETTER_AUTH_SECRET. Each request from the web app now carries a one-time nonce, and the server accepts a signature once, so a request that was captured cannot be sent again.
Version skew
The gateway compares each operator's version with its own when the operator connects.
| Operator compared with the control plane | Result |
|---|---|
| Same minor version, or one minor behind | Supported. |
| Ahead of the control plane | Supported. |
| Two or more minor versions behind, or a previous major version | Reported as upgrade needed. |
| Speaks an older protocol than the server accepts | Reported as upgrade needed. |
Upgrade the operators before the control plane moves two minor versions ahead of them. The metric wardn_gateway_operators, labelled by version and upgrade_needed, shows which versions are connected (Monitoring).
Roll back
Wardn has no down migrations. A database that a newer version migrated may not work with an older server. To go back:
- Stop the control plane (scale the server Deployment to zero, or
docker compose stop server). - Restore the database from the backup you took before the upgrade (Backup and restore).
- Install the earlier chart version, or set the earlier image tags, and start it.
Anything recorded between the backup and the rollback, such as new snapshots and Activity entries, is lost. Operators reconnect by themselves. If you had already upgraded operators, re-run connect with the earlier --image.
helm rollback alone puts the earlier images back but leaves the migrated database as it is, so it is only safe between versions whose upgrade ran no migrations.
Moving between install shapes
The charts share their values, but the bundled database of wardn-tiny and your own database for wardn-standard are different databases. To move, copy the data with pg_dump and pg_restore and reuse the same keys (Backup and restore). There is no automated move.