Skip to content

fix: tolerate node not-ready/unreachable forever on managed pods#21

Merged
CMGS merged 1 commit into
mainfrom
fix/tolerate-node-flap
Jul 18, 2026
Merged

fix: tolerate node not-ready/unreachable forever on managed pods#21
CMGS merged 1 commit into
mainfrom
fix/tolerate-node-flap

Conversation

@CMGS

@CMGS CMGS commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Closes #20.

Problem

newManagedPod tolerates only the vk provider taint, so the apiserver's DefaultTolerationSeconds admission plugin injects the default 300s tolerations for node.kubernetes.io/not-ready / unreachable. When a virtual node stays NotReady past 5 minutes, the taint-eviction-controller batch-deletes every VM pod on it, and vk-cocoon's DeletePod destroys each VM; the recreated pods boot fresh, so running VM state is reset.

That is what happened in the 2026-07-18 mindos incident: a Kine DB lockup failed the vk node's lease renewals → NotReady → 4 VM pods deleted in the same second → VMs reset.

Eviction is pure loss for these pods: they are pinned to one virtual node via NodeSelector, so eviction cannot reschedule them; the node's readiness reflects vk-cocoon's control-plane connectivity, not VM health; and the CocoonSet operator is the component that heals genuinely lost pods.

Fix

Add permanent Exists/NoExecute tolerations for both taints in newManagedPod (nil tolerationSeconds), covering agent and toolbox pods — the same pair the DaemonSet controller injects for node-pinned workloads. Explicit entries suppress the injected 300s pair.

Tests

TestNewManagedPodToleratesNodeFlapForever pins key, Exists, NoExecute, and asserts TolerationSeconds is nil, so a regression restoring the 300s default fails.

Gates

go build / go vet / go test ./... -race green; make lint 0 issues on GOOS=linux and GOOS=darwin.

VM pods are pinned to their virtual node, so taint eviction cannot
reschedule them; it can only delete them, and vk-cocoon then removes the
VM. Without explicit entries the DefaultTolerationSeconds plugin injects
the 300s pair, so any node flap past 5 minutes (e.g. a control-plane DB
lockup failing lease renewals) batch-destroys every VM on the node.
@CMGS
CMGS merged commit 748e3f3 into main Jul 18, 2026
2 checks passed
@CMGS
CMGS deleted the fix/tolerate-node-flap branch July 18, 2026 16:27
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.

fix: VM pods are taint-evicted after 5min of virtual-node NotReady, destroying VM state

1 participant