mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-05 18:24:07 +00:00
Considering all nodes for the scheduler cache to allow lookups
This commit is contained in:
parent
e79f046990
commit
623e7dfa39
@ -449,6 +449,11 @@ func getNodeConditionPredicate() cache.NodeConditionPredicate {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Ignore nodes that are marked unschedulable
|
||||||
|
if node.Spec.Unschedulable {
|
||||||
|
glog.V(4).Infof("Ignoring node %v since it is unschedulable", node.Name)
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -470,9 +475,10 @@ func (factory *ConfigFactory) createAssignedNonTerminatedPodLW() *cache.ListWatc
|
|||||||
|
|
||||||
// createNodeLW returns a cache.ListWatch that gets all changes to nodes.
|
// createNodeLW returns a cache.ListWatch that gets all changes to nodes.
|
||||||
func (factory *ConfigFactory) createNodeLW() *cache.ListWatch {
|
func (factory *ConfigFactory) createNodeLW() *cache.ListWatch {
|
||||||
// TODO: Filter out nodes that doesn't have NodeReady condition.
|
// all nodes are considered to ensure that the scheduler cache has access to all nodes for lookups
|
||||||
fields := fields.Set{api.NodeUnschedulableField: "false"}.AsSelector()
|
// the NodeCondition is used to filter out the nodes that are not ready or unschedulable
|
||||||
return cache.NewListWatchFromClient(factory.Client, "nodes", api.NamespaceAll, fields)
|
// the filtered list is used as the super set of nodes to consider for scheduling
|
||||||
|
return cache.NewListWatchFromClient(factory.Client, "nodes", api.NamespaceAll, fields.ParseSelectorOrDie(""))
|
||||||
}
|
}
|
||||||
|
|
||||||
// createPersistentVolumeLW returns a cache.ListWatch that gets all changes to persistentVolumes.
|
// createPersistentVolumeLW returns a cache.ListWatch that gets all changes to persistentVolumes.
|
||||||
|
Loading…
Reference in New Issue
Block a user