mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Scheduler: execute PreScore right before Score instead of after Filter.
This commit is contained in:
parent
0641e0c6d8
commit
f9b650bc98
@ -166,13 +166,13 @@ func (g *genericScheduler) Schedule(ctx context.Context, prof *profile.Profile,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Run "prefilter" plugins.
|
// Run "prefilter" plugins.
|
||||||
|
startPredicateEvalTime := time.Now()
|
||||||
preFilterStatus := prof.RunPreFilterPlugins(ctx, state, pod)
|
preFilterStatus := prof.RunPreFilterPlugins(ctx, state, pod)
|
||||||
if !preFilterStatus.IsSuccess() {
|
if !preFilterStatus.IsSuccess() {
|
||||||
return result, preFilterStatus.AsError()
|
return result, preFilterStatus.AsError()
|
||||||
}
|
}
|
||||||
trace.Step("Running prefilter plugins done")
|
trace.Step("Running prefilter plugins done")
|
||||||
|
|
||||||
startPredicateEvalTime := time.Now()
|
|
||||||
filteredNodes, filteredNodesStatuses, err := g.findNodesThatFitPod(ctx, prof, state, pod)
|
filteredNodes, filteredNodesStatuses, err := g.findNodesThatFitPod(ctx, prof, state, pod)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
@ -187,13 +187,6 @@ func (g *genericScheduler) Schedule(ctx context.Context, prof *profile.Profile,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run "prescore" plugins.
|
|
||||||
prescoreStatus := prof.RunPreScorePlugins(ctx, state, pod, filteredNodes)
|
|
||||||
if !prescoreStatus.IsSuccess() {
|
|
||||||
return result, prescoreStatus.AsError()
|
|
||||||
}
|
|
||||||
trace.Step("Running prescore plugins done")
|
|
||||||
|
|
||||||
metrics.DeprecatedSchedulingAlgorithmPredicateEvaluationSecondsDuration.Observe(metrics.SinceInSeconds(startPredicateEvalTime))
|
metrics.DeprecatedSchedulingAlgorithmPredicateEvaluationSecondsDuration.Observe(metrics.SinceInSeconds(startPredicateEvalTime))
|
||||||
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PredicateEvaluation).Observe(metrics.SinceInSeconds(startPredicateEvalTime))
|
metrics.DeprecatedSchedulingDuration.WithLabelValues(metrics.PredicateEvaluation).Observe(metrics.SinceInSeconds(startPredicateEvalTime))
|
||||||
|
|
||||||
@ -208,6 +201,13 @@ func (g *genericScheduler) Schedule(ctx context.Context, prof *profile.Profile,
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Run "prescore" plugins.
|
||||||
|
prescoreStatus := prof.RunPreScorePlugins(ctx, state, pod, filteredNodes)
|
||||||
|
if !prescoreStatus.IsSuccess() {
|
||||||
|
return result, prescoreStatus.AsError()
|
||||||
|
}
|
||||||
|
trace.Step("Running prescore plugins done")
|
||||||
|
|
||||||
priorityList, err := g.prioritizeNodes(ctx, prof, state, pod, filteredNodes)
|
priorityList, err := g.prioritizeNodes(ctx, prof, state, pod, filteredNodes)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return result, err
|
return result, err
|
||||||
|
Loading…
Reference in New Issue
Block a user