Files
kubernetes/pkg/controller/nodelifecycle/node_lifecycle_controller.go
Quan Tian f718096b74 NoExecute taint should be added when a Node's ready condition becomes Unknown
After a Node has stopped posting heartbeats for nodeMonitorGracePeriod,
it will be considered unreachable, its ready condition will be set to
Unknown, NoSchedule taint will be added, all Pods on it will be set to
NotReady, but there is always a delay of 5s before NoExecute taint is
added to the Node, adding 5s to the recovery time of Pods which are
supposed to be evicted by the taint and recreated on other Nodes sooner.

The delay is because processTaintBaseEviction() uses the last observed
ready condition of the Node instead of the current one to determine
whether it should add the Node to the taint queue. When a Node is set to
unreachable due to missing heartbeats, the last observed ready condition
is still true and the current ready condition is unknown, we should use
the latter for processTaintBaseEviction().

Signed-off-by: Quan Tian <qtian@vmware.com>
2025-05-10 17:22:11 +08:00

52 KiB