Skip to content

fix(scuttle): stop scuttle-clear-pods before the network on shutdown - #157

Merged
anthr76 merged 1 commit into
mainfrom
fix/scuttle-clear-pods-network-order
Oct 25, 2026
Merged

anthr76 merged 1 commit into
mainfrom
fix/scuttle-clear-pods-network-order

Conversation

@anthr76

@anthr76 anthr76 commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Why

During today's switch+reboot rollout (new scuttle drain + scuttle-clear-pods), worker-1's shutdown logged:

scuttle-clear-pods: Could not read Node worker-1; leaving pods alone: Unable to connect to the server: dial tcp: lookup qgr1…

The unit is only ordered against containerd and kubelet, so on shutdown it can stop after networking/DNS are already down. Its API check then fails, and it (correctly) refuses to clear anything. The reboot wiped the pods anyway, but on a kubelet stop where the network goes down in the same transaction the clear would be skipped. On worker-5 the same shutdown happened to run while the network was still up: Node worker-5 was deleted → Removing 15 pod sandboxes → All pod sandboxes removed.

Change

scuttle-clear-pods: After=network-online.target nss-lookup.target plus Wants=network-online.target, so it stops before the network and resolver on shutdown.

Verification

nix eval worker-2: After=containerd.service network-online.target nss-lookup.target, Wants=network-online.target, Before=docker-kubelet.service. Not yet exercised on a live shutdown. restartIfChanged = false still applies, so deploying it doesn't run the clear.

@anthr76
anthr76 merged commit 72493ff into main Oct 25, 2026
21 of 26 checks passed
@anthr76
anthr76 deleted the fix/scuttle-clear-pods-network-order branch October 25, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant