Repository navigation
fix(scuttle): clear pods after kubelet stops, with a real RPC timeout - #155
Merged
Merged
Conversation
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.
Why
During tonight's rolling reboots the clear-pods step (ExecStopPost of scuttle) logged
DeadlineExceededon most sandbox stop/remove calls and left 32–71 sandboxes per node, while still exiting 0. Reboots hid it; a kubelet restart without a reboot (the Oct 22 case) would leave stale-IP pods again.Two causes:
--timeout).crictl stop --timeout 30andrmpon a busy node exceed it and fail withDeadlineExceeded.After=kubelet, so on a kubelet stop scuttle (and its ExecStopPost) stops first. A live kubelet can recreate sandboxes underneath the clear, which is also why fix(scuttle): keep containerd up while clearing pods; fail if unreachable #153 could only warn about leftovers.Changes
--timeout 60s.scuttle-clear-pods.service(oneshot,RemainAfterExit,ExecStop=clearPods),PartOf/WantedBykubelet,Before=kubelet,After=criService. Stop order on any kubelet stop (restart, switch, shutdown) becomes: scuttle (drain, delete Node) → kubelet → scuttle-clear-pods → containerd.stopp) and removed (rmp -f) individually in up to 3 passes; if any remain, the unit exits 1. With kubelet already stopped, leftovers are a real failure.restartIfChanged = falseon the new unit too, so deploying/changing it never runs the clear mid-switch.After=containerd/ExecStopPostfrom fix(scuttle): keep containerd up while clearing pods; fail if unreachable #153; the UID record (/run/scuttle/node-uid) is unchanged.Verification
nix evalof worker-3:scuttle-clear-pods.servicehasAfter=containerd.service,Before=docker-kubelet.service,PartOf=docker-kubelet.service,WantedBy=multi-user.target docker-kubelet.service,X-RestartIfChanged=false; scuttle keepsBindsTo/Afterkubelet andX-RestartIfChanged=false.systemctl restart docker-kubelet, thenjournalctl -u scuttle -u scuttle-clear-podsshould show the Node deleted →All pod sandboxes removed, and every pod IP should match the node's podCIDR.Not addressed
A plain
systemctl restart docker-kubeletstops scuttle viaBindsTobut doesn't start it again (it is onlyWantedBy=multi-user.target). Pre-existing; worth aPartOffollow-up.