Merge pull request #91258 from alculquicondor/double_spread_weight

Set weight of PodTopologySpread Score to 2
This commit is contained in:
Kubernetes Prow Robot 2020-05-19 23:40:42 -07:00 committed by GitHub
commit 7ba332a839
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 8 deletions

View File

@ -189,7 +189,7 @@ profiles:
{Name: "NodePreferAvoidPods", Weight: 10000},
{Name: "DefaultPodTopologySpread", Weight: 1},
{Name: "TaintToleration", Weight: 1},
{Name: "PodTopologySpread", Weight: 1},
{Name: "PodTopologySpread", Weight: 2},
},
"BindPlugin": {{Name: "DefaultBinder"}},
"ReservePlugin": {{Name: "VolumeBinding"}},
@ -320,7 +320,7 @@ profiles:
{Name: "NodePreferAvoidPods", Weight: 10000},
{Name: "DefaultPodTopologySpread", Weight: 1},
{Name: "TaintToleration", Weight: 1},
{Name: "PodTopologySpread", Weight: 1},
{Name: "PodTopologySpread", Weight: 2},
},
"BindPlugin": {{Name: "DefaultBinder"}},
"ReservePlugin": {{Name: "VolumeBinding"}},

View File

@ -172,7 +172,10 @@ func applyFeatureGates(config *schedulerapi.Plugins) {
config.PreFilter.Enabled = append(config.PreFilter.Enabled, f)
config.Filter.Enabled = append(config.Filter.Enabled, f)
config.PreScore.Enabled = append(config.PreScore.Enabled, f)
s := schedulerapi.Plugin{Name: podtopologyspread.Name, Weight: 1}
// Weight is doubled because:
// - This is a score coming from user preference.
// - It makes its signal comparable to NodeResourcesLeastAllocated.
s := schedulerapi.Plugin{Name: podtopologyspread.Name, Weight: 2}
config.Score.Enabled = append(config.Score.Enabled, s)
}

View File

@ -96,7 +96,7 @@ func TestClusterAutoscalerProvider(t *testing.T) {
{Name: nodepreferavoidpods.Name, Weight: 10000},
{Name: defaultpodtopologyspread.Name, Weight: 1},
{Name: tainttoleration.Name, Weight: 1},
{Name: podtopologyspread.Name, Weight: 1},
{Name: podtopologyspread.Name, Weight: 2},
},
},
Reserve: &schedulerapi.PluginSet{
@ -274,7 +274,7 @@ func TestApplyFeatureGates(t *testing.T) {
{Name: nodepreferavoidpods.Name, Weight: 10000},
{Name: defaultpodtopologyspread.Name, Weight: 1},
{Name: tainttoleration.Name, Weight: 1},
{Name: podtopologyspread.Name, Weight: 1},
{Name: podtopologyspread.Name, Weight: 2},
{Name: noderesources.ResourceLimitsName, Weight: 1},
},
},

View File

@ -1452,7 +1452,7 @@ func TestAlgorithmProviderCompatibility(t *testing.T) {
{Name: "NodePreferAvoidPods", Weight: 10000},
{Name: "DefaultPodTopologySpread", Weight: 1},
{Name: "TaintToleration", Weight: 1},
{Name: "PodTopologySpread", Weight: 1},
{Name: "PodTopologySpread", Weight: 2},
},
"BindPlugin": {{Name: "DefaultBinder"}},
"ReservePlugin": {{Name: "VolumeBinding"}},
@ -1520,7 +1520,7 @@ func TestAlgorithmProviderCompatibility(t *testing.T) {
{Name: "NodePreferAvoidPods", Weight: 10000},
{Name: "DefaultPodTopologySpread", Weight: 1},
{Name: "TaintToleration", Weight: 1},
{Name: "PodTopologySpread", Weight: 1},
{Name: "PodTopologySpread", Weight: 2},
},
"ReservePlugin": {{Name: "VolumeBinding"}},
"UnreservePlugin": {{Name: "VolumeBinding"}},
@ -1608,7 +1608,7 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
{Name: "NodePreferAvoidPods", Weight: 10000},
{Name: "DefaultPodTopologySpread", Weight: 1},
{Name: "TaintToleration", Weight: 1},
{Name: "PodTopologySpread", Weight: 1},
{Name: "PodTopologySpread", Weight: 2},
},
"ReservePlugin": {{Name: "VolumeBinding"}},
"UnreservePlugin": {{Name: "VolumeBinding"}},