Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Fix drain log for unreachable Nodes #11147

Merged
merged 1 commit into from
Sep 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion internal/controllers/machine/machine_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -686,7 +686,15 @@ func (r *Reconciler) drainNode(ctx context.Context, cluster *clusterv1.Cluster,
// Override the grace period of pods to reduce the time needed to skip them.
drainer.GracePeriodSeconds = 1

log.V(3).Info("Node is unreachable, draining will use 1s GracePeriodSeconds and will ignore all Pods that have a deletionTimestamp > 1s old. PDBs are still honored.")
// Our drain code still respects PDBs when evicting Pods, but that does not mean they are respected
// in general by the entire system.
// When a Node becomes unreachable the following happens:
// * node.kubernetes.io/unreachable:NoExecute taint is set on the Node
// * taint manager will evict Pods immediately because of the NoExecute taint (without respecting PDBs)
// * https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/#concepts
// "NoExecute": "Pods that do not tolerate the taint are evicted immediately""
// * our drain code will now ignore the Pods (as they quickly have a deletionTimestamp older than 2 seconds)
log.V(3).Info("Node is unreachable, draining will use 1s GracePeriodSeconds and will ignore all Pods that have a deletionTimestamp > 1s old")
}

if err := drainer.CordonNode(ctx, node); err != nil {
Expand Down
Loading