diff --git a/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go b/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go index 5b70ab03442..5848121dee6 100644 --- a/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go +++ b/pkg/scheduler/framework/plugins/interpodaffinity/scoring.go @@ -212,8 +212,9 @@ func getPreScoreState(cycleState *framework.CycleState) (*preScoreState, error) } // Score invoked at the Score extension point. -// The "score" returned in this function is the matching number of pods on the `nodeName`, +// The "score" returned in this function is the sum of weights got from cycleState which have its topologyKey matching with the node's labels. // it is normalized later. +// Note: the returned "score" is positive for pod-affinity, and negative for pod-antiaffinity. func (pl *InterPodAffinity) Score(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) { nodeInfo, err := pl.sharedLister.NodeInfos().Get(nodeName) if err != nil || nodeInfo.Node() == nil { @@ -236,8 +237,6 @@ func (pl *InterPodAffinity) Score(ctx context.Context, cycleState *framework.Cyc } // NormalizeScore normalizes the score for each filteredNode. -// The basic rule is: the bigger the score(matching number of pods) is, the smaller the -// final normalized score will be. func (pl *InterPodAffinity) NormalizeScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, scores framework.NodeScoreList) *framework.Status { s, err := getPreScoreState(cycleState) if err != nil {