Skip to content

Commit 57d197f

Browse files
authored
Merge pull request kubernetes#124430 from AllenXu93/fix-kubelet-restart-notReady
fix node notReady in first sync period after kubelet restart
2 parents c75e30d + 4bfc731 commit 57d197f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pkg/kubelet/kubelet.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,13 @@ func (kl *Kubelet) Run(updates <-chan kubetypes.PodUpdate) {
16601660
// Introduce some small jittering to ensure that over time the requests won't start
16611661
// accumulating at approximately the same time from the set of nodes due to priority and
16621662
// fairness effect.
1663-
go wait.JitterUntil(kl.syncNodeStatus, kl.nodeStatusUpdateFrequency, 0.04, true, wait.NeverStop)
1663+
go func() {
1664+
// Call updateRuntimeUp once before syncNodeStatus to make sure kubelet had already checked runtime state
1665+
// otherwise when restart kubelet, syncNodeStatus will report node notReady in first report period
1666+
kl.updateRuntimeUp()
1667+
wait.JitterUntil(kl.syncNodeStatus, kl.nodeStatusUpdateFrequency, 0.04, true, wait.NeverStop)
1668+
}()
1669+
16641670
go kl.fastStatusUpdateOnce()
16651671

16661672
// start syncing lease

0 commit comments

Comments
 (0)