Skip to content
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