Details
-
Sub-task
-
Status: Closed
-
Major
-
Resolution: Won't Fix
-
None
-
None
-
None
Description
The current flow for predicate:
Tryallocate -> TryNodes -> TryNode -> Shim Predicate(including prefilter and filter)
If we can change to:
Tryallocate -> Shim Prefilter -> TryNodes -> TryNode -> Shim filter
The current implementation put PreFilter together with Filter into Predicates, the Predicate process each pod-node pair like the following code:
for pod in pods: for nodes in nodes: prePredicate(pod) # prefilters predicate(pod, node) # filters
It's functioning well while PreFilter only needs the pod object(no node required), we don't need to put it in the inner loop. So a promotion of PreFilter to the outer loop is made in this jira for performance's sake, such as a plugin like inter-pod-afftinity is very time-consuming to prepare the pod interconnections in PreFilter. After this proposal, it will be:
for pod in pods: prePredicate(pod) # prefilters for nodes in nodes: predicate(pod, node) # filters
Also for PreemptionPredicates we also can ahead the PreFilter!
cc wilfreds ccondit Peter Bacsko