Upgrading Ubuntu 24.04 to 26.04
This guide upgrades the operating system of Kubernetes master and worker nodes in place with Ubuntu's do-release-upgrade tool. It follows the official Ubuntu Server upgrade guide and adds the steps specific to OpenCRVS nodes. Read the Ubuntu 26.04 LTS release notes before you start.
Before you start
OpenCRVS v2.1 or later is required. Ubuntu 26.04 support was added in v2.1. Upgrade OpenCRVS and run the Provision environment action first, while the nodes are still on 24.04.
Take a snapshot of every node with your cloud provider, and create a manual backup. If a node fails, restore its snapshot.
Make sure you can reach the nodes through the provider's web console in case SSH does not come back.
Make sure no GitHub Actions workflow (deployment, provisioning) is running for the environment. The in-cluster runner that executes them is stopped when its node is drained.
Upgrade one node at a time, workers first and the master last.
If you use a backup server, upgrade it separately and never while the master reboots. With disk encryption, the master fetches its encryption key from the backup server on boot. The backup server has no Kubernetes steps.
1. Drain the node
Drain every node, including the master. Run from the master node or from your workstation (Kubernetes cluster access). See Safely drain a node.
The drain stops application pods gracefully, so databases shut down cleanly before the upgrade restarts containerd and reboots the node. Stateless pods move to other nodes. Data stores (PostgreSQL, MongoDB, Elasticsearch, InfluxDB) are pinned to the node that holds their data, by default the master, so they stay Pending until you uncordon the node. This is the expected downtime. Control plane pods (API server, etcd) are not evicted, so kubectl keeps working on the master.
The drain may print Cannot evict pod as it would violate the pod's disruption budget and retry every 5 seconds. This is normal and usually clears within a minute, once the replacement pod is ready on another node.
If the same pod stays blocked for a few minutes, its replacement has nowhere to start. This is typical on the master of a single-node cluster, for calico-system/calico-apiserver-*. That pod is stateless and serves only the Calico API. Pod networking keeps working, because calico-node runs as a DaemonSet. Delete just that pod to bypass its PodDisruptionBudget, and the drain continues:
For any other blocked pod, find out why its replacement does not start (kubectl get pdb -A, kubectl get pods -A -o wide) before bypassing the budget.
The in-cluster GitHub runner pod (actions-runner-system/opencrvs-infra-runner-*) can take a minute or more to stop. The Actions Runner Controller first has to unregister the runner from GitHub, and it waits while a workflow job is running. If the pod stays Terminating for more than a few minutes, check that no job is running and look at the controller:
If no job is running and the controller cannot finish (it is not running, or cannot reach GitHub), remove the pod's finalizer. The RunnerDeployment then creates a new runner pod:
2. Prepare the node
SSH to the node as an admin user and open a root shell. Run the node commands in steps 2-4 in it, so a sudo problem after the upgrade cannot lock you out.
Bring the node fully up to date, as required by Ubuntu:
do-release-upgrade starts a fallback SSH daemon on port 1022. The OpenCRVS firewall blocks it by default, so open it temporarily:
Check that Ubuntu offers the new release:
Ubuntu offers LTS-to-LTS upgrades only after the first point release (26.04.1). If no release is offered, check that Prompt=lts is set in /etc/update-manager/release-upgrades. Do not use the -d flag on production nodes, it selects the development release.
3. Run the upgrade
Answer the prompts as follows:
Continue running under SSH, start an additional sshd on port 1022, start the upgrade
Yes
A modified configuration file has a new package version, for example /etc/ssh/sshd_config, /etc/pam.d/sshd (2FA), /etc/ssh/moduli, /etc/apt/apt.conf.d/50unattended-upgrades, /etc/default/grub
Keep the currently installed version (the default). The list is not exhaustive: for any other file, press D to review the differences first
Restart services during package upgrades
Yes, the node is drained
Remove obsolete packages
Yes
Restart now
No, run the checks below first
4. Check before rebooting
If both pass, reboot:
5. Verify and return the node to the cluster
SSH back in, open the root shell (sudo -i) and run:
Then run kubectl from the master or your workstation. On the master, log in as your normal user, not root: kubectl is configured for user accounts, so leave the root shell first.
Repeat steps 1-5 for the next node.
After all nodes are upgraded
Run the Provision environment GitHub action with the
alltag (Provisioning servers). It re-adds the Kubernetes and Docker apt repositories for Ubuntu 26.04.Check that the self-hosted runner is online under Settings → Actions → Runners.
Run the validation checks.
Known issue: sudo-rs
Ubuntu 26.04 replaces sudo with sudo-rs by default. sudo-rs rejects wildcards in command arguments. OpenCRVS uses them for users with the operator role (SSH access). If you have such users, visudo -c fails and sudo stops working for all users with wildcards are not allowed in command arguments.
Until the sudoers rules are updated, switch back to the original sudo from your root shell, then run visudo -c again:
Last updated