mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-09 13:12:20 +00:00
Switch away from the static node info
This commit is contained in:
@@ -64,17 +64,12 @@ func (factory *ConfigFactory) Create() (*scheduler.Config, error) {
|
||||
|
||||
r := rand.New(rand.NewSource(time.Now().UnixNano()))
|
||||
|
||||
// TODO: remove this construction-time listing.
|
||||
nodes, err := factory.Client.ListMinions()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
algo := algorithm.NewGenericScheduler(
|
||||
[]algorithm.FitPredicate{
|
||||
// Fit is defined based on the absence of port conflicts.
|
||||
algorithm.PodFitsPorts,
|
||||
// Fit is determined by resource availability
|
||||
algorithm.NewResourceFitPredicate(algorithm.StaticNodeInfo{nodes}),
|
||||
algorithm.NewResourceFitPredicate(algorithm.ClientNodeInfo{factory.Client}),
|
||||
},
|
||||
// All nodes where things fit are equally likely (Random)
|
||||
algorithm.EqualPriority,
|
||||
|
Reference in New Issue
Block a user