mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Merge pull request #83184 from odinuge/dynamic-kubelet-config
Fix init order during starup for dynamic kubelet config
This commit is contained in:
commit
91b2a7af87
@ -589,14 +589,6 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies, stopCh <-chan
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the kubelet config controller is available, and dynamic config is enabled, start the config and status sync loops
|
|
||||||
if utilfeature.DefaultFeatureGate.Enabled(features.DynamicKubeletConfig) && len(s.DynamicConfigDir.Value()) > 0 &&
|
|
||||||
kubeDeps.KubeletConfigController != nil && !standaloneMode && !s.RunOnce {
|
|
||||||
if err := kubeDeps.KubeletConfigController.StartSync(kubeDeps.KubeClient, kubeDeps.EventClient, string(nodeName)); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if kubeDeps.Auth == nil {
|
if kubeDeps.Auth == nil {
|
||||||
auth, err := BuildAuth(nodeName, kubeDeps.KubeClient, s.KubeletConfiguration)
|
auth, err := BuildAuth(nodeName, kubeDeps.KubeClient, s.KubeletConfiguration)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -721,6 +713,14 @@ func run(s *options.KubeletServer, kubeDeps *kubelet.Dependencies, stopCh <-chan
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// If the kubelet config controller is available, and dynamic config is enabled, start the config and status sync loops
|
||||||
|
if utilfeature.DefaultFeatureGate.Enabled(features.DynamicKubeletConfig) && len(s.DynamicConfigDir.Value()) > 0 &&
|
||||||
|
kubeDeps.KubeletConfigController != nil && !standaloneMode && !s.RunOnce {
|
||||||
|
if err := kubeDeps.KubeletConfigController.StartSync(kubeDeps.KubeClient, kubeDeps.EventClient, string(nodeName)); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if s.HealthzPort > 0 {
|
if s.HealthzPort > 0 {
|
||||||
mux := http.NewServeMux()
|
mux := http.NewServeMux()
|
||||||
healthz.InstallHandler(mux)
|
healthz.InstallHandler(mux)
|
||||||
|
Loading…
Reference in New Issue
Block a user