Skip to content

test(uat): add kube cluster upgrade VM scenarios and an operator guide - #1514

Draft
alex-au wants to merge 2 commits into
mainfrom
01508-cluster-upgrade-uat
Draft

alex-au wants to merge 2 commits into
mainfrom
01508-cluster-upgrade-uat

Conversation

@alex-au

@alex-au alex-au commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Description

Adds a UAT for kube cluster upgrade that runs on real VMs from a cluster an older release installed, and an
operator guide for the upgrade. The scenarios cover the main path, other starting points, the feature gate
and refused input, a step that fails, a run that is killed, and other commands after the upgrade. Each
scenario is a script that prints one PASS or FAIL line per check.

What is in it

File What it is
docs/dev/cluster-upgrade-uat.md The scenarios: how each one runs and what it expects
docs/upgrading-the-cluster.md For operators: before you start, what each step does to the node (measured), what to do when a step fails or the run is killed
test/uat/cluster-upgrade/lib.sh Shared helpers: checks, the downtime probe, walking to a step, a deny webhook to make a step fail
test/uat/cluster-upgrade/setup.sh The starting cluster: v0.35.0 installs it (with block node, ESO, Alloy, or bare), then this build
test/uat/cluster-upgrade/group-a.sh ... group-f.sh One script per group
test/uat/cluster-upgrade/group-tty.sh C3, C7 and E1, which need a terminal: run in a tmux pane, answered with keys
docs/commands/README.md, docs/dev/cluster-upgrade.md, docs/dev/acceptance-tests.md, CLAUDE.md Links to the new pages

How it was run

Build bfd0cb86 (main), linux/arm64, on 3 vCPU / 4 GiB UTM clones of the golden image, 3-4 at a time on
one Mac, 2026-12-02 to 12-03. Each scenario got a fresh clone. The host-side runner (cloning, MAC, DHCP,
queueing) is not in this PR; the doc says what it must do.

Results

40 scenarios; 39 ran on VMs. Only D3 is not scripted (see below).

Group Scenarios PASS FAIL Notes
A main path A1-A8 101 1 The FAIL was a script bug (wrong system.yaml key); the record was checked by hand: cri-o 1.36.7
B start states B2, B6, B3 24 0
B1 bare 11 0
B4 stop at 1.34, continue 15 + 17 2 + 0 Run 1 hit finding 1; run 2 passed
B5 v0.24 start 4 0 v0.24 also installs Kubernetes 1.33.4 / Cilium 1.18.1, so it plans like v0.35
C gate and safety C1, C2, C4, C5, C6 26 4 C4's JSON check is finding 4 (2 more FAILs follow from it)
D a step fails D1, D2, D4, D6, D7, D8 117 0
D5 Cilium 16 + 19 3 + 0 Run 1: the blocker is cilium-mismatch, and finding 1; run 2 waits for Cilium and passes
E killed part way E2, E3 (chain) 20 8 E2 and E3 recover; E4 is finding 5; E5 in the chain was blocked by E4
E5 on its own 13 3 Finding 5
E6 SIGHUP 13 + 14 1 + 0 Run 1's re-run: kubeadm apply failed, cause lost (finding 6); run 2 recovered
F after the upgrade F1, F2, F4 (reboot), F5 22 + 14 0
On a terminal C3, C7, E1 25 2 C3 passes. C7 stops correctly, but the reason is not on the screen (finding 7). E1 is finding 8; its FAIL was a wrong check (the step had finished in the background, so the re-run applied the next one), since fixed in the script
C3, C7, E1 again, with E1's new checks 26 3 Findings 7 and 8 again on a second VM. E1: the step was done within 194 s of Ctrl-C; at 375 s the CLI still ran and had recorded nothing

Downtime per step, from A (block node service / API server unreachable, total and longest gap):

Step Time Block node API server Block node restarted
node-exporter swap 10 s 0 s 0 s no
ESO 0.20 -> 2.13 44 s 0 s 0 s no
Cilium patch / minor 55-62 s 0 s 0 s no
Kubernetes 1.33.4 -> 1.33.13 (patch) 216 s 0 s 65 s / 65 s no
Kubernetes 1.33.13 -> 1.34.13 (minor) 748 s 174 s 449 s / 381 s yes
--all --to 1.35 (Cilium 1.20, Kubernetes 1.35) 786 s 133 s 468 s / 404 s yes
--all (MetalLB, Kubernetes 1.36, refresh) 621 s 106 s 330 s / 231 s yes

Findings (not fixed here)

  1. The Cilium step refuses while Cilium restarts, right after a Kubernetes minor step (1 of 3 runs) or a helm rollback.
  2. The Kubernetes step fails if kubectl is running while it is replaced (text file busy).
  3. After a failed Kubernetes minor step, the failure handler gives up before cri-o is up and leaves the kubelet stopped; the API server stays down.
  4. --output json on a terminal applies without asking; the guard that should refuse never runs.
  5. A Kubernetes step killed after its cordon leaves the node cordoned; the next chart step then fails and leaves a failed release that blocks every run (evidence for fix(kube): kube cluster upgrade is not resilient to process kill/SIGHUP (leftover cordon, no signal recovery) #1506).
  6. A failed kubeadm upgrade apply loses kubeadm's own output (automa RunBashScriptContext).
  7. On a terminal, output after a workflow ran can be lost: a walk stopped by a plan change ends on "Completed successfully" and exits 1 with no reason. Likely cause: CaptureOutput replaces os.Stdout/os.Stderr, and GC then closes fd 1 and 2.
  8. A single Ctrl-C on a terminal freezes the screen. The Kubernetes step finishes in the background, but the CLI never exits and records nothing (evidence for fix(kube): kube cluster upgrade is not resilient to process kill/SIGHUP (leftover cordon, no signal recovery) #1506).

The operator guide says what to do for each until they are fixed. Issue drafts are ready to file.

Not scripted

  • D3: cri-o failing to install after its old release was moved aside. Nothing outside the provisioner can cause it; unit tests cover the move back.

Related Issues

Scripts under test/uat/cluster-upgrade/ build a cluster with v0.35.0,
then run this build's `kube cluster upgrade` through the main path,
other starting points, the gate and refused input, failed steps,
killed runs, terminal-only cases, and other commands after the
upgrade. Each check prints one PASS or FAIL line.

docs/dev/cluster-upgrade-uat.md lists the scenarios, how to run them,
and what each one expects.

Refs #1508

Signed-off-by: alex-au <alex.w.aus@gmail.com>
What each upgrade step does to the node, measured on a VM, and what
to do when a step fails or the run is killed. Linked from the Upgrade
section of docs/commands/README.md.

Refs #1508

Signed-off-by: alex-au <alex.w.aus@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(kube): failure-scenario tests for kube cluster upgrade on a VM

1 participant