UPSTREAM: 66350: Start cloudResourceSyncsManager before getNodeAnyWay (initializeModules) to avoid kubelet getting stuck in retrieving node addresses from a cloudprovider
@@ -1342,6 +1342,11 @@ func (kl *Kubelet) Run(updates <-chan kubetypes.PodUpdate) {
glog.Warning("No api server defined - no node status update will be sent.")
}
+ // Start the cloud provider sync manager
+ if kl.cloudResourceSyncManager != nil {
+ go kl.cloudResourceSyncManager.Run(wait.NeverStop)
+ }
+
if err := kl.initializeModules(); err != nil {
kl.recorder.Eventf(kl.nodeRef, v1.EventTypeWarning, events.KubeletSetupFailed, err.Error())
glog.Fatal(err)
@@ -1365,11 +1370,6 @@ func (kl *Kubelet) Run(updates <-chan kubetypes.PodUpdate) {
// handled by pod workers).
go wait.Until(kl.podKiller, 1*time.Second, wait.NeverStop)
- // Start the cloud provider sync manager
- if kl.cloudResourceSyncManager != nil {
- go kl.cloudResourceSyncManager.Run(wait.NeverStop)
- }
-
// Start component sync loops.
kl.statusManager.Start()
kl.probeManager.Start()
