Skip to content

Commit 831e017

Browse files
authored
Merge pull request kubernetes-sigs#11147 from sbueringer/pr-fix-drain-log
🐛 Fix drain log for unreachable Nodes
2 parents a6109b7 + ac46f9f commit 831e017

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

internal/controllers/machine/machine_controller.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,15 @@ func (r *Reconciler) drainNode(ctx context.Context, cluster *clusterv1.Cluster,
686686
// Override the grace period of pods to reduce the time needed to skip them.
687687
drainer.GracePeriodSeconds = 1
688688

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

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

0 commit comments

Comments
 (0)