Skip to content

fix: only wait on the machines an update brings up - #66

Open
riadelhajjaji-scality wants to merge 1 commit into
mainfrom
bugfix/MK8S-519-wait-only-on-new-machines
Open

riadelhajjaji-scality wants to merge 1 commit into
mainfrom
bugfix/MK8S-519-wait-only-on-new-machines

Conversation

@riadelhajjaji-scality

@riadelhajjaji-scality riadelhajjaji-scality commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Why

Updating a platform fails at the wait-for-boot step on machines that were left alone:

node-2 booted badly, cloud-init exited 1
PermissionError: [Errno 13] Permission denied: '/run/cloud-init/cloud.cfg'

Example: https://github.com/scality/metalk8s/actions/runs/40701329682 (bootstrap-restore, red on MetalK8s 134.0 and 136.0 since it moved to platform-spawner)

wait-for-boot was a single command checking every machine, re-run whenever any instance changed. Removing node-1 therefore asked cloud-init again on the bastion, node-2 and node-3, which had been in use for an hour.

On Rocky 9, cloud-init ships a tmpfiles rule keeping /run/cloud-init to root (0700), and systemd runs every tmpfiles rule again whenever a package ships one. Once MetalK8s has installed its packages, cloud-init status can no longer read its runtime config as the SSH user (canonical/cloud-init#6680). A freshly booted machine does not show it, which is why spawns always went through. The bastion, where nothing is installed, passes too.

Running it through sudo is no fix: on ARTESCA, artesca-os is not allowed to run cloud-init through sudo once the product is installed, and ARTESCA spawns from snapshots of installed clusters.

What it does

Gives each machine its own wait-for-boot-<machine> command, triggered by that machine's instance only. An update now waits on the machines it brings up, which are fresh, and leaves the others alone. The check itself is unchanged and still runs as the SSH user. The bastion setup waits on all of them as before.

Since the waits are renamed, updating a platform spawned before this change waits once more on every machine. Only a MetalK8s nightly running across the release would see it.

Once merged, a GA patch release (v3.2.3) moves v3 so that callers get the fix without changing anything on their side.

This PR overrites the closed #65 .

Closes MK8S-519

Updating a platform waited again on every machine, the ones left alone
included. On a Rocky machine where anything installed a package since
it booted, `cloud-init status` then failed for the SSH user with a
PermissionError on /run/cloud-init/cloud.cfg, and the update failed
with "booted badly, cloud-init exited 1".

The cloud-init package keeps /run/cloud-init to root through a
tmpfiles rule, and the systemd package runs every tmpfiles rule again
whenever a package ships one, so cloud-init can no longer read its own
runtime config for anybody else (canonical/cloud-init#6680). Freshly
booted machines do not show it, which is why spawns went through.
Asking as root is no way out: on ARTESCA the SSH user is not allowed
to run cloud-init through sudo once the product is installed.

Each machine now has a wait of its own, triggered by that machine
only. An update waits on the machines it brought up, which are fresh,
and leaves the others alone. The waits are named after the machine, so
an update of a platform spawned before this change waits once more on
every machine.

Refs: MK8S-519
@riadelhajjaji-scality
riadelhajjaji-scality requested a review from a team as a code owner October 29, 2026 11:08
@riadelhajjaji-scality riadelhajjaji-scality changed the title ix: only wait on the machines an update brings up fix: only wait on the machines an update brings up Oct 29, 2026
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.

1 participant