diff --git a/cmd/kured/main.go b/cmd/kured/main.go index 3ad1cbee2..0c31ac221 100644 --- a/cmd/kured/main.go +++ b/cmd/kured/main.go @@ -761,16 +761,24 @@ func rebootAsRequired(nodeID string, booter reboot.Reboot, sentinelCommand []str blockCheckers = append(blockCheckers, KubernetesBlockingChecker{client: client, nodename: nodeID, filter: podSelectors}) } + rebootBlocked := rebootBlocked(blockCheckers...) + var rebootRequiredBlockCondition string - if rebootBlocked(blockCheckers...) { + if rebootBlocked { rebootRequiredBlockCondition = ", but blocked at this time" - continue } + log.Infof("Reboot required%s", rebootRequiredBlockCondition) - if !holding(lock, &nodeMeta, concurrency > 1) && !acquire(lock, &nodeMeta, TTL, concurrency) { - // Prefer to not schedule pods onto this node to avoid draing the same pod multiple times. + if rebootBlocked { + // Prefer to not schedule pods onto this node to avoid draining the same pod multiple times. preferNoScheduleTaint.Enable() + // We've logged that the reboot is needed, but curently blocked, and have tainted the node. + continue + } + + if !holding(lock, &nodeMeta, concurrency > 1) && !acquire(lock, &nodeMeta, TTL, concurrency) { + // If we can't acquire the lock, poll again continue }