Upgrading FlowAssembly

An upgrade replaces the platform’s images with a newer version. The applications running on it, their releases and their cases stay as they are: each case carries on in the release it started in.

How an upgrade works

  • The database changes first, and only by adding. Each new pod applies the new version’s database changes before it starts. One pod at a time does so, and the rest wait. Changes only ever add to the database, so the version still running keeps working on it.

  • Services are replaced one pod at a time. While Kubernetes rolls the pods, the previous version and the new one run side by side on the same database. People keep working, and nothing they submit is lost.

  • Cases carry on. A case started before the upgrade continues after it, in the same release, with its history in one record.

Every change to FlowAssembly is checked this way before it is merged:

  • an instance of the previous version is upgraded with cases in flight;

  • the previous version’s web server is run on the upgraded database;

  • the new version carries those cases on.

Before you start

  1. Read what changed. Check the new version’s notes for new settings and anything you must do.

  2. Back up the database. Take a snapshot or backup you have restored before, so you can go back if you need to (Backing up and recovering).

  3. Check the image. Check the new images’ signatures (see Using the published images), and note their digests.

  4. Check the settings with the new version. Run the new image’s fa config check against your settings and secrets:

    docker run --rm -v "$PWD/config:/config" -e FA_CONFIG=/config/flowassembly.yaml \
      ghcr.io/dave-aganran/flowassembly@sha256:<new digest> config check
    
  5. Choose a quiet time, and tell people. An upgrade does not stop people working, but a quiet time makes a problem easier to spot. Admin > Settings > Maintenance shows a notice to everyone, at sign-in too.

Upgrade on Kubernetes

  1. In your overlay’s images section, change both images to the new version’s digests. Change scripts.kubernetes.image in the instance settings to the new script runtime image.

  2. Apply the overlay:

    kubectl apply -k deploy/kubernetes/overlays/<yours>
    kubectl rollout status deployment -l app.kubernetes.io/part-of=flowassembly --timeout=10m
    
  3. Check it, as below.

  4. Only now add any new settings the version brings. The previous version refuses settings it does not know, so adding them before every pod is replaced would stop its pods restarting.

Upgrade a workstation

From a copy of FlowAssembly at the new version, run the set-up again:

bash deploy/workstation/setup.sh --user <you>

It keeps the cluster, the database and the secrets, and brings the images and settings up to date.

Check it

  • /readyz answers on each service, and every pod is ready.

  • Admin > Settings > System info shows each service heard from in the last minute, at the new version, with no failed passes.

  • Admin > Settings > Queues shows work moving.

  • Someone opens a case started before the upgrade, and completes a task.

  • The FlowAssemblyServiceFailing and FlowAssemblyWebErrors alerts stay quiet.

If something is wrong

  • Go back to the previous images. Set the previous digests in the overlay and apply it again. The previous version works on the upgraded database, which is what each upgrade is checked for, so there is no need to restore it.

  • Restore the backup only if the data itself is wrong. Restoring loses everything done since the backup, so it is a last resort. Stop every service first, restore, then start the previous version.

  • Remove any new settings you added before going back.

Then see Troubleshooting, and keep the service logs from the upgrade for whoever looks into it.