mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-25 12:17:52 +00:00
Set leader-elect for kube-scheduler to true
Thanks to some great sleuthing by ikruglov!
kube-controller-manager defaults --leader-elect to true. We should
do the same for kube-scheduler. kube-scheduler used to have this
set to true, but it got lost during refactoring in:
efb2bb71cd
This commit is contained in:
@@ -152,8 +152,14 @@ func NewOptions() (*Options, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// TODO: we should fix this up better (PR 59732)
|
||||
o.config.LeaderElection.LeaderElect = true
|
||||
externalConfig := &componentconfigv1alpha1.KubeSchedulerConfiguration{}
|
||||
// Assume we are starting with an empty external configuration, we apply
|
||||
// defaults and then convert it into an internal data structure. This helps
|
||||
// ensure that all the defaults are applied correctly (example LeaderElect)
|
||||
o.scheme.Default(externalConfig)
|
||||
if err := o.scheme.Convert(externalConfig, o.config, nil); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return o, nil
|
||||
}
|
||||
|
Reference in New Issue
Block a user