Repository navigation
k3s: The boot after a shutdown deletes the pods it left Failed - #42
Merged
Merged
Conversation
The drain skips DaemonSet pods. At shutdown the kubelet stops them (reason Terminated), and while it shuts down it turns away the ones their controller keeps re-creating (NodeShutdown, as Cilium's did in the example NAS suite). Those pods stay Failed: nothing collects them before thousands pile up, and the example suite's shutdown subtest fails on them. k3s-uncordon now deletes this node's Failed pods with either reason, before it lifts the cordon. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
andsens
enabled auto-merge (squash)
November 20, 2026 07:41
andsens
added a commit
to nixos-homelab/example
that referenced
this pull request
Nov 20, 2026
nixos-homelab/shared#42: k3s-uncordon deletes the NodeShutdown and Terminated pods the last shutdown left, which the shutdown subtest failed on once shared#40 got the drain through. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
andsens
added a commit
to nixos-homelab/example
that referenced
this pull request
Nov 20, 2026
…status (#20) * nas, tests: setup-secrets cluster helpers, and the suite on its exit status The example cluster's INWX sources and destinations go through shared's kubeSecretSource and kubeSecretDestination, so they are in the cluster group that runs after k3s. setup-secrets --auto now exits 1 for a failed fetch or destination. The suite's runs accept only what Plex being down in the VM explains (its API key, read from the workload, and the three destinations that need it) and fail on anything else. The homelab inputs are bumped to the merged setup-secrets work. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tests: The early setup-secrets runs may wait for the servarr keys On CI the servarr apps were still waiting for their databases, which those first runs make, so their API keys, read from the workloads, couldn't be fetched yet. The two runs of the apps subtest accept that; the run after every workload is up still accepts only Plex. A destination now passes only when it was skipped for one of those keys, never when its own command failed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * flake.lock: shared with the cleanup of pods a shutdown leaves Failed nixos-homelab/shared#42: k3s-uncordon deletes the NodeShutdown and Terminated pods the last shutdown left, which the shutdown subtest failed on once shared#40 got the drain through. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Found on nixos-homelab/example#20, which brings #40 (the longer drain) to example: the suite's shutdown subtest got past the
drainedcheck and failed on the next assertion, Failed pods with reasonNodeShutdown/Terminatedafter the reboot.The drain (
--ignore-daemonsets) skips DaemonSet pods. At shutdown the kubelet stops them (Terminated), and while it shuts down it rejects the pods their controller keeps re-creating (NodeShutdown). In the CI log:"Pod admission denied" pod="cilium/cilium-n5htk" reason="NodeShutdown", thencilium-bjkf8. Those pods stay Failed: the pod GC collects terminated pods only past its threshold of thousands.k3s-uncordonnow deletes this node's Failed pods with either reason, before it lifts the cordon, so the node is clean once it's marked back. The pods are replaced already. The unit retries every 10 s on failure, as before, if the API isn't up yet.Checked:
checks.k3spasses locally (its shutdown subtest included, 58 s), plus deadnix and manifests. The script builds underwriteShellApplication(shellcheck).🤖 Generated with Claude Code