mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 02:09:56 +00:00
kubelet: initialization of runtime service earlier in the startup
This patch refactors the kubelet startup code to initialize the runtime service earlier in the startup sequence. We want this to be able to query the cgroup driver setting from the CRI befure initializing the cgroup manager.
This commit is contained in:
parent
37330a1392
commit
fd434003f3
@ -625,6 +625,10 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend
|
||||
runAuthenticatorCAReload(ctx.Done())
|
||||
}
|
||||
|
||||
if err := kubelet.PreInitRuntimeService(&s.KubeletConfiguration, kubeDeps); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
var cgroupRoots []string
|
||||
nodeAllocatableRoot := cm.NodeAllocatableRoot(s.CgroupRoot, s.CgroupsPerQOS, s.CgroupDriver)
|
||||
cgroupRoots = append(cgroupRoots, nodeAllocatableRoot)
|
||||
@ -775,11 +779,6 @@ func run(ctx context.Context, s *options.KubeletServer, kubeDeps *kubelet.Depend
|
||||
klog.InfoS("Failed to ApplyOOMScoreAdj", "err", err)
|
||||
}
|
||||
|
||||
err = kubelet.PreInitRuntimeService(&s.KubeletConfiguration, kubeDeps)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
if err := RunKubelet(s, kubeDeps, s.RunOnce); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user