mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 05:27:21 +00:00
Init Kubelet runtime cache before dependent stats provider
This commit is contained in:
parent
4d8e5d5d7e
commit
a82c84e087
@ -652,6 +652,12 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
|
|||||||
klet.containerRuntime = runtime
|
klet.containerRuntime = runtime
|
||||||
klet.runner = runtime
|
klet.runner = runtime
|
||||||
|
|
||||||
|
runtimeCache, err := kubecontainer.NewRuntimeCache(klet.containerRuntime)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
klet.runtimeCache = runtimeCache
|
||||||
|
|
||||||
if cadvisor.UsingLegacyCadvisorStats(containerRuntime, remoteRuntimeEndpoint) {
|
if cadvisor.UsingLegacyCadvisorStats(containerRuntime, remoteRuntimeEndpoint) {
|
||||||
klet.StatsProvider = stats.NewCadvisorStatsProvider(
|
klet.StatsProvider = stats.NewCadvisorStatsProvider(
|
||||||
klet.cadvisor,
|
klet.cadvisor,
|
||||||
@ -780,11 +786,6 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration,
|
|||||||
experimentalCheckNodeCapabilitiesBeforeMount,
|
experimentalCheckNodeCapabilitiesBeforeMount,
|
||||||
keepTerminatedPodVolumes)
|
keepTerminatedPodVolumes)
|
||||||
|
|
||||||
runtimeCache, err := kubecontainer.NewRuntimeCache(klet.containerRuntime)
|
|
||||||
if err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
klet.runtimeCache = runtimeCache
|
|
||||||
klet.reasonCache = NewReasonCache()
|
klet.reasonCache = NewReasonCache()
|
||||||
klet.workQueue = queue.NewBasicWorkQueue(klet.clock)
|
klet.workQueue = queue.NewBasicWorkQueue(klet.clock)
|
||||||
klet.podWorkers = newPodWorkers(klet.syncPod, kubeDeps.Recorder, klet.workQueue, klet.resyncInterval, backOffPeriod, klet.podCache)
|
klet.podWorkers = newPodWorkers(klet.syncPod, kubeDeps.Recorder, klet.workQueue, klet.resyncInterval, backOffPeriod, klet.podCache)
|
||||||
|
Loading…
Reference in New Issue
Block a user