Skip to content

Commit

Permalink
Merge pull request kubernetes#124430 from AllenXu93/fix-kubelet-resta…
Browse files Browse the repository at this point in the history
…rt-notReady

fix node notReady in first sync period after kubelet restart
  • Loading branch information
k8s-ci-robot authored Jul 24, 2024
2 parents c75e30d + 4bfc731 commit 57d197f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/kubelet/kubelet.go
Original file line number Diff line number Diff line change
Expand Up @@ -1660,7 +1660,13 @@ func (kl *Kubelet) Run(updates <-chan kubetypes.PodUpdate) {
// Introduce some small jittering to ensure that over time the requests won't start
// accumulating at approximately the same time from the set of nodes due to priority and
// fairness effect.
go wait.JitterUntil(kl.syncNodeStatus, kl.nodeStatusUpdateFrequency, 0.04, true, wait.NeverStop)
go func() {
// Call updateRuntimeUp once before syncNodeStatus to make sure kubelet had already checked runtime state
// otherwise when restart kubelet, syncNodeStatus will report node notReady in first report period
kl.updateRuntimeUp()
wait.JitterUntil(kl.syncNodeStatus, kl.nodeStatusUpdateFrequency, 0.04, true, wait.NeverStop)
}()

go kl.fastStatusUpdateOnce()

// start syncing lease
Expand Down

0 comments on commit 57d197f

Please sign in to comment.