mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Rename DefaultPodTopologySpread plugin #91994
This commit is contained in:
parent
ad29e168dc
commit
d44a20f9ca
@ -185,7 +185,7 @@ profiles:
|
|||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "PodTopologySpread"},
|
{Name: "PodTopologySpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
{Name: "NodeResourcesBalancedAllocation", Weight: 1},
|
{Name: "NodeResourcesBalancedAllocation", Weight: 1},
|
||||||
@ -196,7 +196,7 @@ profiles:
|
|||||||
{Name: "NodePreferAvoidPods", Weight: 10000},
|
{Name: "NodePreferAvoidPods", Weight: 10000},
|
||||||
{Name: "PodTopologySpread", Weight: 2},
|
{Name: "PodTopologySpread", Weight: 2},
|
||||||
{Name: "TaintToleration", Weight: 1},
|
{Name: "TaintToleration", Weight: 1},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 1},
|
{Name: "SelectorSpread", Weight: 1},
|
||||||
},
|
},
|
||||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||||
"ReservePlugin": {{Name: "VolumeBinding"}},
|
"ReservePlugin": {{Name: "VolumeBinding"}},
|
||||||
@ -315,7 +315,7 @@ profiles:
|
|||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "PodTopologySpread"},
|
{Name: "PodTopologySpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
{Name: "NodeResourcesBalancedAllocation", Weight: 1},
|
{Name: "NodeResourcesBalancedAllocation", Weight: 1},
|
||||||
@ -326,7 +326,7 @@ profiles:
|
|||||||
{Name: "NodePreferAvoidPods", Weight: 10000},
|
{Name: "NodePreferAvoidPods", Weight: 10000},
|
||||||
{Name: "PodTopologySpread", Weight: 2},
|
{Name: "PodTopologySpread", Weight: 2},
|
||||||
{Name: "TaintToleration", Weight: 1},
|
{Name: "TaintToleration", Weight: 1},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 1},
|
{Name: "SelectorSpread", Weight: 1},
|
||||||
},
|
},
|
||||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||||
"ReservePlugin": {{Name: "VolumeBinding"}},
|
"ReservePlugin": {{Name: "VolumeBinding"}},
|
||||||
|
@ -297,7 +297,7 @@ const (
|
|||||||
// alpha: v1.19
|
// alpha: v1.19
|
||||||
//
|
//
|
||||||
// Enables the use of PodTopologySpread scheduling plugin to do default
|
// Enables the use of PodTopologySpread scheduling plugin to do default
|
||||||
// spreading and disables legacy DefaultPodTopologySpread plugin.
|
// spreading and disables legacy SelectorSpread plugin.
|
||||||
DefaultPodTopologySpread featuregate.Feature = "DefaultPodTopologySpread"
|
DefaultPodTopologySpread featuregate.Feature = "DefaultPodTopologySpread"
|
||||||
|
|
||||||
// owner: @tallclair
|
// owner: @tallclair
|
||||||
|
@ -14,7 +14,6 @@ go_library(
|
|||||||
"//pkg/features:go_default_library",
|
"//pkg/features:go_default_library",
|
||||||
"//pkg/scheduler/apis/config:go_default_library",
|
"//pkg/scheduler/apis/config:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/defaultbinder:go_default_library",
|
"//pkg/scheduler/framework/plugins/defaultbinder:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/defaultpodtopologyspread:go_default_library",
|
|
||||||
"//pkg/scheduler/framework/plugins/defaultpreemption:go_default_library",
|
"//pkg/scheduler/framework/plugins/defaultpreemption:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/imagelocality:go_default_library",
|
"//pkg/scheduler/framework/plugins/imagelocality:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/interpodaffinity:go_default_library",
|
"//pkg/scheduler/framework/plugins/interpodaffinity:go_default_library",
|
||||||
@ -27,6 +26,7 @@ go_library(
|
|||||||
"//pkg/scheduler/framework/plugins/nodevolumelimits:go_default_library",
|
"//pkg/scheduler/framework/plugins/nodevolumelimits:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/podtopologyspread:go_default_library",
|
"//pkg/scheduler/framework/plugins/podtopologyspread:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/queuesort:go_default_library",
|
"//pkg/scheduler/framework/plugins/queuesort:go_default_library",
|
||||||
|
"//pkg/scheduler/framework/plugins/selectorspread:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/tainttoleration:go_default_library",
|
"//pkg/scheduler/framework/plugins/tainttoleration:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/volumebinding:go_default_library",
|
"//pkg/scheduler/framework/plugins/volumebinding:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/volumerestrictions:go_default_library",
|
"//pkg/scheduler/framework/plugins/volumerestrictions:go_default_library",
|
||||||
@ -44,7 +44,6 @@ go_test(
|
|||||||
"//pkg/features:go_default_library",
|
"//pkg/features:go_default_library",
|
||||||
"//pkg/scheduler/apis/config:go_default_library",
|
"//pkg/scheduler/apis/config:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/defaultbinder:go_default_library",
|
"//pkg/scheduler/framework/plugins/defaultbinder:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/defaultpodtopologyspread:go_default_library",
|
|
||||||
"//pkg/scheduler/framework/plugins/defaultpreemption:go_default_library",
|
"//pkg/scheduler/framework/plugins/defaultpreemption:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/imagelocality:go_default_library",
|
"//pkg/scheduler/framework/plugins/imagelocality:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/interpodaffinity:go_default_library",
|
"//pkg/scheduler/framework/plugins/interpodaffinity:go_default_library",
|
||||||
@ -57,6 +56,7 @@ go_test(
|
|||||||
"//pkg/scheduler/framework/plugins/nodevolumelimits:go_default_library",
|
"//pkg/scheduler/framework/plugins/nodevolumelimits:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/podtopologyspread:go_default_library",
|
"//pkg/scheduler/framework/plugins/podtopologyspread:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/queuesort:go_default_library",
|
"//pkg/scheduler/framework/plugins/queuesort:go_default_library",
|
||||||
|
"//pkg/scheduler/framework/plugins/selectorspread:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/tainttoleration:go_default_library",
|
"//pkg/scheduler/framework/plugins/tainttoleration:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/volumebinding:go_default_library",
|
"//pkg/scheduler/framework/plugins/volumebinding:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/volumerestrictions:go_default_library",
|
"//pkg/scheduler/framework/plugins/volumerestrictions:go_default_library",
|
||||||
|
@ -25,7 +25,6 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/features"
|
"k8s.io/kubernetes/pkg/features"
|
||||||
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
|
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpodtopologyspread"
|
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpreemption"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpreemption"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/imagelocality"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/imagelocality"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity"
|
||||||
@ -38,6 +37,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
|
||||||
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/selectorspread"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumerestrictions"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumerestrictions"
|
||||||
@ -170,8 +170,8 @@ func applyFeatureGates(config *schedulerapi.Plugins) {
|
|||||||
if !utilfeature.DefaultFeatureGate.Enabled(features.DefaultPodTopologySpread) {
|
if !utilfeature.DefaultFeatureGate.Enabled(features.DefaultPodTopologySpread) {
|
||||||
// When feature is enabled, the default spreading is done by
|
// When feature is enabled, the default spreading is done by
|
||||||
// PodTopologySpread plugin, which is enabled by default.
|
// PodTopologySpread plugin, which is enabled by default.
|
||||||
klog.Infof("Registering DefaultPodTopologySpread plugin")
|
klog.Infof("Registering SelectorSpread plugin")
|
||||||
s := schedulerapi.Plugin{Name: defaultpodtopologyspread.Name}
|
s := schedulerapi.Plugin{Name: selectorspread.Name}
|
||||||
config.PreScore.Enabled = append(config.PreScore.Enabled, s)
|
config.PreScore.Enabled = append(config.PreScore.Enabled, s)
|
||||||
s.Weight = 1
|
s.Weight = 1
|
||||||
config.Score.Enabled = append(config.Score.Enabled, s)
|
config.Score.Enabled = append(config.Score.Enabled, s)
|
||||||
|
@ -28,7 +28,6 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/features"
|
"k8s.io/kubernetes/pkg/features"
|
||||||
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
|
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpodtopologyspread"
|
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/imagelocality"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/imagelocality"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity"
|
||||||
@ -40,6 +39,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
|
||||||
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/selectorspread"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumerestrictions"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumerestrictions"
|
||||||
@ -91,7 +91,7 @@ func TestClusterAutoscalerProvider(t *testing.T) {
|
|||||||
{Name: interpodaffinity.Name},
|
{Name: interpodaffinity.Name},
|
||||||
{Name: podtopologyspread.Name},
|
{Name: podtopologyspread.Name},
|
||||||
{Name: tainttoleration.Name},
|
{Name: tainttoleration.Name},
|
||||||
{Name: defaultpodtopologyspread.Name},
|
{Name: selectorspread.Name},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Score: &schedulerapi.PluginSet{
|
Score: &schedulerapi.PluginSet{
|
||||||
@ -104,7 +104,7 @@ func TestClusterAutoscalerProvider(t *testing.T) {
|
|||||||
{Name: nodepreferavoidpods.Name, Weight: 10000},
|
{Name: nodepreferavoidpods.Name, Weight: 10000},
|
||||||
{Name: podtopologyspread.Name, Weight: 2},
|
{Name: podtopologyspread.Name, Weight: 2},
|
||||||
{Name: tainttoleration.Name, Weight: 1},
|
{Name: tainttoleration.Name, Weight: 1},
|
||||||
{Name: defaultpodtopologyspread.Name, Weight: 1},
|
{Name: selectorspread.Name, Weight: 1},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Reserve: &schedulerapi.PluginSet{
|
Reserve: &schedulerapi.PluginSet{
|
||||||
@ -183,7 +183,7 @@ func TestApplyFeatureGates(t *testing.T) {
|
|||||||
{Name: interpodaffinity.Name},
|
{Name: interpodaffinity.Name},
|
||||||
{Name: podtopologyspread.Name},
|
{Name: podtopologyspread.Name},
|
||||||
{Name: tainttoleration.Name},
|
{Name: tainttoleration.Name},
|
||||||
{Name: defaultpodtopologyspread.Name},
|
{Name: selectorspread.Name},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Score: &schedulerapi.PluginSet{
|
Score: &schedulerapi.PluginSet{
|
||||||
@ -196,7 +196,7 @@ func TestApplyFeatureGates(t *testing.T) {
|
|||||||
{Name: nodepreferavoidpods.Name, Weight: 10000},
|
{Name: nodepreferavoidpods.Name, Weight: 10000},
|
||||||
{Name: podtopologyspread.Name, Weight: 2},
|
{Name: podtopologyspread.Name, Weight: 2},
|
||||||
{Name: tainttoleration.Name, Weight: 1},
|
{Name: tainttoleration.Name, Weight: 1},
|
||||||
{Name: defaultpodtopologyspread.Name, Weight: 1},
|
{Name: selectorspread.Name, Weight: 1},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Reserve: &schedulerapi.PluginSet{
|
Reserve: &schedulerapi.PluginSet{
|
||||||
|
@ -136,11 +136,11 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{Name: "NodeLabel"},
|
{Name: "NodeLabel"},
|
||||||
{Name: "ServiceAffinity"},
|
{Name: "ServiceAffinity"},
|
||||||
},
|
},
|
||||||
"PreScorePlugin": {{Name: "DefaultPodTopologySpread"}},
|
"PreScorePlugin": {{Name: "SelectorSpread"}},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
{Name: "NodeResourcesLeastAllocated", Weight: 1},
|
{Name: "NodeResourcesLeastAllocated", Weight: 1},
|
||||||
{Name: "NodeLabel", Weight: 4},
|
{Name: "NodeLabel", Weight: 4},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 2},
|
{Name: "SelectorSpread", Weight: 2},
|
||||||
{Name: "ServiceAffinity", Weight: 3},
|
{Name: "ServiceAffinity", Weight: 3},
|
||||||
},
|
},
|
||||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||||
@ -191,12 +191,12 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{Name: "NodeLabel"},
|
{Name: "NodeLabel"},
|
||||||
{Name: "ServiceAffinity"},
|
{Name: "ServiceAffinity"},
|
||||||
},
|
},
|
||||||
"PreScorePlugin": {{Name: "DefaultPodTopologySpread"}},
|
"PreScorePlugin": {{Name: "SelectorSpread"}},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
{Name: "NodeResourcesBalancedAllocation", Weight: 2},
|
{Name: "NodeResourcesBalancedAllocation", Weight: 2},
|
||||||
{Name: "NodeResourcesLeastAllocated", Weight: 2},
|
{Name: "NodeResourcesLeastAllocated", Weight: 2},
|
||||||
{Name: "NodeLabel", Weight: 8}, // Weight is 4 * number of LabelPreference priorities
|
{Name: "NodeLabel", Weight: 8}, // Weight is 4 * number of LabelPreference priorities
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 2},
|
{Name: "SelectorSpread", Weight: 2},
|
||||||
{Name: "ServiceAffinity", Weight: 6}, // Weight is the 3 * number of custom ServiceAntiAffinity priorities
|
{Name: "ServiceAffinity", Weight: 6}, // Weight is the 3 * number of custom ServiceAntiAffinity priorities
|
||||||
},
|
},
|
||||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||||
@ -254,14 +254,14 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{Name: "AzureDiskLimits"},
|
{Name: "AzureDiskLimits"},
|
||||||
{Name: "VolumeZone"},
|
{Name: "VolumeZone"},
|
||||||
},
|
},
|
||||||
"PreScorePlugin": {{Name: "DefaultPodTopologySpread"}},
|
"PreScorePlugin": {{Name: "SelectorSpread"}},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
{Name: "NodeResourcesBalancedAllocation", Weight: 2},
|
{Name: "NodeResourcesBalancedAllocation", Weight: 2},
|
||||||
{Name: "ImageLocality", Weight: 2},
|
{Name: "ImageLocality", Weight: 2},
|
||||||
{Name: "NodeResourcesLeastAllocated", Weight: 2},
|
{Name: "NodeResourcesLeastAllocated", Weight: 2},
|
||||||
{Name: "NodeAffinity", Weight: 2},
|
{Name: "NodeAffinity", Weight: 2},
|
||||||
{Name: "NodeLabel", Weight: 4},
|
{Name: "NodeLabel", Weight: 4},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 2},
|
{Name: "SelectorSpread", Weight: 2},
|
||||||
{Name: "ServiceAffinity", Weight: 3},
|
{Name: "ServiceAffinity", Weight: 3},
|
||||||
},
|
},
|
||||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||||
@ -326,7 +326,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"PreScorePlugin": {
|
"PreScorePlugin": {
|
||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
@ -335,7 +335,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{Name: "InterPodAffinity", Weight: 2},
|
{Name: "InterPodAffinity", Weight: 2},
|
||||||
{Name: "NodeResourcesLeastAllocated", Weight: 2},
|
{Name: "NodeResourcesLeastAllocated", Weight: 2},
|
||||||
{Name: "NodeAffinity", Weight: 2},
|
{Name: "NodeAffinity", Weight: 2},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 2},
|
{Name: "SelectorSpread", Weight: 2},
|
||||||
{Name: "TaintToleration", Weight: 2},
|
{Name: "TaintToleration", Weight: 2},
|
||||||
},
|
},
|
||||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||||
@ -402,7 +402,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"PreScorePlugin": {
|
"PreScorePlugin": {
|
||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
@ -413,7 +413,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{Name: "NodeResourcesMostAllocated", Weight: 2},
|
{Name: "NodeResourcesMostAllocated", Weight: 2},
|
||||||
{Name: "NodeAffinity", Weight: 2},
|
{Name: "NodeAffinity", Weight: 2},
|
||||||
{Name: "NodePreferAvoidPods", Weight: 2},
|
{Name: "NodePreferAvoidPods", Weight: 2},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 2},
|
{Name: "SelectorSpread", Weight: 2},
|
||||||
{Name: "TaintToleration", Weight: 2},
|
{Name: "TaintToleration", Weight: 2},
|
||||||
},
|
},
|
||||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||||
@ -489,7 +489,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"PreScorePlugin": {
|
"PreScorePlugin": {
|
||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
@ -500,7 +500,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{Name: "NodeResourcesMostAllocated", Weight: 2},
|
{Name: "NodeResourcesMostAllocated", Weight: 2},
|
||||||
{Name: "NodeAffinity", Weight: 2},
|
{Name: "NodeAffinity", Weight: 2},
|
||||||
{Name: "NodePreferAvoidPods", Weight: 2},
|
{Name: "NodePreferAvoidPods", Weight: 2},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 2},
|
{Name: "SelectorSpread", Weight: 2},
|
||||||
{Name: "TaintToleration", Weight: 2},
|
{Name: "TaintToleration", Weight: 2},
|
||||||
},
|
},
|
||||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||||
@ -587,7 +587,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"PreScorePlugin": {
|
"PreScorePlugin": {
|
||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
@ -598,7 +598,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{Name: "NodeResourcesMostAllocated", Weight: 2},
|
{Name: "NodeResourcesMostAllocated", Weight: 2},
|
||||||
{Name: "NodeAffinity", Weight: 2},
|
{Name: "NodeAffinity", Weight: 2},
|
||||||
{Name: "NodePreferAvoidPods", Weight: 2},
|
{Name: "NodePreferAvoidPods", Weight: 2},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 2},
|
{Name: "SelectorSpread", Weight: 2},
|
||||||
{Name: "TaintToleration", Weight: 2},
|
{Name: "TaintToleration", Weight: 2},
|
||||||
},
|
},
|
||||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||||
@ -688,7 +688,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"PreScorePlugin": {
|
"PreScorePlugin": {
|
||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
@ -699,7 +699,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{Name: "NodeResourcesMostAllocated", Weight: 2},
|
{Name: "NodeResourcesMostAllocated", Weight: 2},
|
||||||
{Name: "NodeAffinity", Weight: 2},
|
{Name: "NodeAffinity", Weight: 2},
|
||||||
{Name: "NodePreferAvoidPods", Weight: 2},
|
{Name: "NodePreferAvoidPods", Weight: 2},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 2},
|
{Name: "SelectorSpread", Weight: 2},
|
||||||
{Name: "TaintToleration", Weight: 2},
|
{Name: "TaintToleration", Weight: 2},
|
||||||
},
|
},
|
||||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||||
@ -794,7 +794,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"PreScorePlugin": {
|
"PreScorePlugin": {
|
||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
@ -805,7 +805,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{Name: "NodeResourcesMostAllocated", Weight: 2},
|
{Name: "NodeResourcesMostAllocated", Weight: 2},
|
||||||
{Name: "NodeAffinity", Weight: 2},
|
{Name: "NodeAffinity", Weight: 2},
|
||||||
{Name: "NodePreferAvoidPods", Weight: 2},
|
{Name: "NodePreferAvoidPods", Weight: 2},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 2},
|
{Name: "SelectorSpread", Weight: 2},
|
||||||
{Name: "TaintToleration", Weight: 2},
|
{Name: "TaintToleration", Weight: 2},
|
||||||
},
|
},
|
||||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||||
@ -912,7 +912,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"PreScorePlugin": {
|
"PreScorePlugin": {
|
||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
@ -924,7 +924,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{Name: "NodeAffinity", Weight: 2},
|
{Name: "NodeAffinity", Weight: 2},
|
||||||
{Name: "NodePreferAvoidPods", Weight: 2},
|
{Name: "NodePreferAvoidPods", Weight: 2},
|
||||||
{Name: "RequestedToCapacityRatio", Weight: 2},
|
{Name: "RequestedToCapacityRatio", Weight: 2},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 2},
|
{Name: "SelectorSpread", Weight: 2},
|
||||||
{Name: "TaintToleration", Weight: 2},
|
{Name: "TaintToleration", Weight: 2},
|
||||||
},
|
},
|
||||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||||
@ -1033,7 +1033,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"PreScorePlugin": {
|
"PreScorePlugin": {
|
||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
@ -1045,7 +1045,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{Name: "NodeAffinity", Weight: 2},
|
{Name: "NodeAffinity", Weight: 2},
|
||||||
{Name: "NodePreferAvoidPods", Weight: 2},
|
{Name: "NodePreferAvoidPods", Weight: 2},
|
||||||
{Name: "RequestedToCapacityRatio", Weight: 2},
|
{Name: "RequestedToCapacityRatio", Weight: 2},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 2},
|
{Name: "SelectorSpread", Weight: 2},
|
||||||
{Name: "TaintToleration", Weight: 2},
|
{Name: "TaintToleration", Weight: 2},
|
||||||
},
|
},
|
||||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||||
@ -1154,7 +1154,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"PreScorePlugin": {
|
"PreScorePlugin": {
|
||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
@ -1166,7 +1166,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{Name: "NodeAffinity", Weight: 2},
|
{Name: "NodeAffinity", Weight: 2},
|
||||||
{Name: "NodePreferAvoidPods", Weight: 2},
|
{Name: "NodePreferAvoidPods", Weight: 2},
|
||||||
{Name: "RequestedToCapacityRatio", Weight: 2},
|
{Name: "RequestedToCapacityRatio", Weight: 2},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 2},
|
{Name: "SelectorSpread", Weight: 2},
|
||||||
{Name: "TaintToleration", Weight: 2},
|
{Name: "TaintToleration", Weight: 2},
|
||||||
},
|
},
|
||||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||||
@ -1279,7 +1279,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"PreScorePlugin": {
|
"PreScorePlugin": {
|
||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
@ -1291,7 +1291,7 @@ func TestCompatibility_v1_Scheduler(t *testing.T) {
|
|||||||
{Name: "NodeAffinity", Weight: 2},
|
{Name: "NodeAffinity", Weight: 2},
|
||||||
{Name: "NodePreferAvoidPods", Weight: 2},
|
{Name: "NodePreferAvoidPods", Weight: 2},
|
||||||
{Name: "RequestedToCapacityRatio", Weight: 2},
|
{Name: "RequestedToCapacityRatio", Weight: 2},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 2},
|
{Name: "SelectorSpread", Weight: 2},
|
||||||
{Name: "TaintToleration", Weight: 2},
|
{Name: "TaintToleration", Weight: 2},
|
||||||
},
|
},
|
||||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||||
@ -1409,7 +1409,7 @@ func TestAlgorithmProviderCompatibility(t *testing.T) {
|
|||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "PodTopologySpread"},
|
{Name: "PodTopologySpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
{Name: "NodeResourcesBalancedAllocation", Weight: 1},
|
{Name: "NodeResourcesBalancedAllocation", Weight: 1},
|
||||||
@ -1420,7 +1420,7 @@ func TestAlgorithmProviderCompatibility(t *testing.T) {
|
|||||||
{Name: "NodePreferAvoidPods", Weight: 10000},
|
{Name: "NodePreferAvoidPods", Weight: 10000},
|
||||||
{Name: "PodTopologySpread", Weight: 2},
|
{Name: "PodTopologySpread", Weight: 2},
|
||||||
{Name: "TaintToleration", Weight: 1},
|
{Name: "TaintToleration", Weight: 1},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 1},
|
{Name: "SelectorSpread", Weight: 1},
|
||||||
},
|
},
|
||||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||||
"ReservePlugin": {{Name: "VolumeBinding"}},
|
"ReservePlugin": {{Name: "VolumeBinding"}},
|
||||||
@ -1479,7 +1479,7 @@ func TestAlgorithmProviderCompatibility(t *testing.T) {
|
|||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "PodTopologySpread"},
|
{Name: "PodTopologySpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
{Name: "NodeResourcesBalancedAllocation", Weight: 1},
|
{Name: "NodeResourcesBalancedAllocation", Weight: 1},
|
||||||
@ -1490,7 +1490,7 @@ func TestAlgorithmProviderCompatibility(t *testing.T) {
|
|||||||
{Name: "NodePreferAvoidPods", Weight: 10000},
|
{Name: "NodePreferAvoidPods", Weight: 10000},
|
||||||
{Name: "PodTopologySpread", Weight: 2},
|
{Name: "PodTopologySpread", Weight: 2},
|
||||||
{Name: "TaintToleration", Weight: 1},
|
{Name: "TaintToleration", Weight: 1},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 1},
|
{Name: "SelectorSpread", Weight: 1},
|
||||||
},
|
},
|
||||||
"ReservePlugin": {{Name: "VolumeBinding"}},
|
"ReservePlugin": {{Name: "VolumeBinding"}},
|
||||||
"PreBindPlugin": {{Name: "VolumeBinding"}},
|
"PreBindPlugin": {{Name: "VolumeBinding"}},
|
||||||
@ -1569,7 +1569,7 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
|
|||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "PodTopologySpread"},
|
{Name: "PodTopologySpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
{Name: "NodeResourcesBalancedAllocation", Weight: 1},
|
{Name: "NodeResourcesBalancedAllocation", Weight: 1},
|
||||||
@ -1580,7 +1580,7 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
|
|||||||
{Name: "NodePreferAvoidPods", Weight: 10000},
|
{Name: "NodePreferAvoidPods", Weight: 10000},
|
||||||
{Name: "PodTopologySpread", Weight: 2},
|
{Name: "PodTopologySpread", Weight: 2},
|
||||||
{Name: "TaintToleration", Weight: 1},
|
{Name: "TaintToleration", Weight: 1},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 1},
|
{Name: "SelectorSpread", Weight: 1},
|
||||||
},
|
},
|
||||||
"ReservePlugin": {{Name: "VolumeBinding"}},
|
"ReservePlugin": {{Name: "VolumeBinding"}},
|
||||||
"PreBindPlugin": {{Name: "VolumeBinding"}},
|
"PreBindPlugin": {{Name: "VolumeBinding"}},
|
||||||
@ -1770,7 +1770,7 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
|
|||||||
PreScore: &config.PluginSet{
|
PreScore: &config.PluginSet{
|
||||||
Disabled: []config.Plugin{
|
Disabled: []config.Plugin{
|
||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
{Name: "PodTopologySpread"},
|
{Name: "PodTopologySpread"},
|
||||||
},
|
},
|
||||||
@ -1783,7 +1783,7 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
|
|||||||
{Name: "NodeResourcesLeastAllocated"},
|
{Name: "NodeResourcesLeastAllocated"},
|
||||||
{Name: "NodeAffinity"},
|
{Name: "NodeAffinity"},
|
||||||
{Name: "NodePreferAvoidPods"},
|
{Name: "NodePreferAvoidPods"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
{Name: "PodTopologySpread"},
|
{Name: "PodTopologySpread"},
|
||||||
},
|
},
|
||||||
@ -1856,7 +1856,7 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
|
|||||||
PreScore: &config.PluginSet{
|
PreScore: &config.PluginSet{
|
||||||
Enabled: []config.Plugin{
|
Enabled: []config.Plugin{
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
},
|
},
|
||||||
Disabled: []config.Plugin{
|
Disabled: []config.Plugin{
|
||||||
@ -1866,7 +1866,7 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
|
|||||||
Score: &config.PluginSet{
|
Score: &config.PluginSet{
|
||||||
Enabled: []config.Plugin{
|
Enabled: []config.Plugin{
|
||||||
{Name: "TaintToleration", Weight: 24},
|
{Name: "TaintToleration", Weight: 24},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 24},
|
{Name: "SelectorSpread", Weight: 24},
|
||||||
{Name: "NodePreferAvoidPods", Weight: 24},
|
{Name: "NodePreferAvoidPods", Weight: 24},
|
||||||
{Name: "NodeAffinity", Weight: 24},
|
{Name: "NodeAffinity", Weight: 24},
|
||||||
{Name: "NodeResourcesLeastAllocated", Weight: 24},
|
{Name: "NodeResourcesLeastAllocated", Weight: 24},
|
||||||
@ -1913,12 +1913,12 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
|
|||||||
},
|
},
|
||||||
"PreScorePlugin": {
|
"PreScorePlugin": {
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
{Name: "TaintToleration", Weight: 24},
|
{Name: "TaintToleration", Weight: 24},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 24},
|
{Name: "SelectorSpread", Weight: 24},
|
||||||
{Name: "NodePreferAvoidPods", Weight: 24},
|
{Name: "NodePreferAvoidPods", Weight: 24},
|
||||||
{Name: "NodeAffinity", Weight: 24},
|
{Name: "NodeAffinity", Weight: 24},
|
||||||
{Name: "NodeResourcesLeastAllocated", Weight: 24},
|
{Name: "NodeResourcesLeastAllocated", Weight: 24},
|
||||||
|
@ -199,7 +199,7 @@ func SetDefaults_VolumeBindingArgs(obj *v1beta1.VolumeBindingArgs) {
|
|||||||
func SetDefaults_PodTopologySpreadArgs(obj *v1beta1.PodTopologySpreadArgs) {
|
func SetDefaults_PodTopologySpreadArgs(obj *v1beta1.PodTopologySpreadArgs) {
|
||||||
if !feature.DefaultFeatureGate.Enabled(features.DefaultPodTopologySpread) {
|
if !feature.DefaultFeatureGate.Enabled(features.DefaultPodTopologySpread) {
|
||||||
// When feature is disabled, the default spreading is done by legacy
|
// When feature is disabled, the default spreading is done by legacy
|
||||||
// DefaultPodTopologySpread plugin.
|
// SelectorSpread plugin.
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if obj.DefaultConstraints == nil {
|
if obj.DefaultConstraints == nil {
|
||||||
|
@ -39,10 +39,10 @@ go_test(
|
|||||||
deps = [
|
deps = [
|
||||||
"//pkg/scheduler/apis/config:go_default_library",
|
"//pkg/scheduler/apis/config:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/defaultbinder:go_default_library",
|
"//pkg/scheduler/framework/plugins/defaultbinder:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/defaultpodtopologyspread:go_default_library",
|
|
||||||
"//pkg/scheduler/framework/plugins/noderesources:go_default_library",
|
"//pkg/scheduler/framework/plugins/noderesources:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/podtopologyspread:go_default_library",
|
"//pkg/scheduler/framework/plugins/podtopologyspread:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/queuesort:go_default_library",
|
"//pkg/scheduler/framework/plugins/queuesort:go_default_library",
|
||||||
|
"//pkg/scheduler/framework/plugins/selectorspread:go_default_library",
|
||||||
"//pkg/scheduler/framework/runtime:go_default_library",
|
"//pkg/scheduler/framework/runtime:go_default_library",
|
||||||
"//pkg/scheduler/framework/v1alpha1:go_default_library",
|
"//pkg/scheduler/framework/v1alpha1:go_default_library",
|
||||||
"//pkg/scheduler/framework/v1alpha1/fake:go_default_library",
|
"//pkg/scheduler/framework/v1alpha1/fake:go_default_library",
|
||||||
|
@ -36,10 +36,10 @@ import (
|
|||||||
clientsetfake "k8s.io/client-go/kubernetes/fake"
|
clientsetfake "k8s.io/client-go/kubernetes/fake"
|
||||||
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
|
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpodtopologyspread"
|
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
|
||||||
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/selectorspread"
|
||||||
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
|
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
|
||||||
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
|
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
|
||||||
fakeframework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1/fake"
|
fakeframework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1/fake"
|
||||||
@ -1013,8 +1013,8 @@ func TestZeroRequest(t *testing.T) {
|
|||||||
st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New),
|
st.RegisterQueueSortPlugin(queuesort.Name, queuesort.New),
|
||||||
st.RegisterScorePlugin(noderesources.LeastAllocatedName, noderesources.NewLeastAllocated, 1),
|
st.RegisterScorePlugin(noderesources.LeastAllocatedName, noderesources.NewLeastAllocated, 1),
|
||||||
st.RegisterScorePlugin(noderesources.BalancedAllocationName, noderesources.NewBalancedAllocation, 1),
|
st.RegisterScorePlugin(noderesources.BalancedAllocationName, noderesources.NewBalancedAllocation, 1),
|
||||||
st.RegisterScorePlugin(defaultpodtopologyspread.Name, defaultpodtopologyspread.New, 1),
|
st.RegisterScorePlugin(selectorspread.Name, selectorspread.New, 1),
|
||||||
st.RegisterPreScorePlugin(defaultpodtopologyspread.Name, defaultpodtopologyspread.New),
|
st.RegisterPreScorePlugin(selectorspread.Name, selectorspread.New),
|
||||||
st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New),
|
st.RegisterBindPlugin(defaultbinder.Name, defaultbinder.New),
|
||||||
}
|
}
|
||||||
fwk, err := st.NewFramework(
|
fwk, err := st.NewFramework(
|
||||||
|
@ -11,7 +11,6 @@ go_library(
|
|||||||
deps = [
|
deps = [
|
||||||
"//pkg/scheduler/apis/config:go_default_library",
|
"//pkg/scheduler/apis/config:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/defaultbinder:go_default_library",
|
"//pkg/scheduler/framework/plugins/defaultbinder:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/defaultpodtopologyspread:go_default_library",
|
|
||||||
"//pkg/scheduler/framework/plugins/defaultpreemption:go_default_library",
|
"//pkg/scheduler/framework/plugins/defaultpreemption:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/imagelocality:go_default_library",
|
"//pkg/scheduler/framework/plugins/imagelocality:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/interpodaffinity:go_default_library",
|
"//pkg/scheduler/framework/plugins/interpodaffinity:go_default_library",
|
||||||
@ -25,6 +24,7 @@ go_library(
|
|||||||
"//pkg/scheduler/framework/plugins/nodevolumelimits:go_default_library",
|
"//pkg/scheduler/framework/plugins/nodevolumelimits:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/podtopologyspread:go_default_library",
|
"//pkg/scheduler/framework/plugins/podtopologyspread:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/queuesort:go_default_library",
|
"//pkg/scheduler/framework/plugins/queuesort:go_default_library",
|
||||||
|
"//pkg/scheduler/framework/plugins/selectorspread:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/serviceaffinity:go_default_library",
|
"//pkg/scheduler/framework/plugins/serviceaffinity:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/tainttoleration:go_default_library",
|
"//pkg/scheduler/framework/plugins/tainttoleration:go_default_library",
|
||||||
"//pkg/scheduler/framework/plugins/volumebinding:go_default_library",
|
"//pkg/scheduler/framework/plugins/volumebinding:go_default_library",
|
||||||
@ -48,7 +48,6 @@ filegroup(
|
|||||||
srcs = [
|
srcs = [
|
||||||
":package-srcs",
|
":package-srcs",
|
||||||
"//pkg/scheduler/framework/plugins/defaultbinder:all-srcs",
|
"//pkg/scheduler/framework/plugins/defaultbinder:all-srcs",
|
||||||
"//pkg/scheduler/framework/plugins/defaultpodtopologyspread:all-srcs",
|
|
||||||
"//pkg/scheduler/framework/plugins/defaultpreemption:all-srcs",
|
"//pkg/scheduler/framework/plugins/defaultpreemption:all-srcs",
|
||||||
"//pkg/scheduler/framework/plugins/examples:all-srcs",
|
"//pkg/scheduler/framework/plugins/examples:all-srcs",
|
||||||
"//pkg/scheduler/framework/plugins/helper:all-srcs",
|
"//pkg/scheduler/framework/plugins/helper:all-srcs",
|
||||||
@ -64,6 +63,7 @@ filegroup(
|
|||||||
"//pkg/scheduler/framework/plugins/nodevolumelimits:all-srcs",
|
"//pkg/scheduler/framework/plugins/nodevolumelimits:all-srcs",
|
||||||
"//pkg/scheduler/framework/plugins/podtopologyspread:all-srcs",
|
"//pkg/scheduler/framework/plugins/podtopologyspread:all-srcs",
|
||||||
"//pkg/scheduler/framework/plugins/queuesort:all-srcs",
|
"//pkg/scheduler/framework/plugins/queuesort:all-srcs",
|
||||||
|
"//pkg/scheduler/framework/plugins/selectorspread:all-srcs",
|
||||||
"//pkg/scheduler/framework/plugins/serviceaffinity:all-srcs",
|
"//pkg/scheduler/framework/plugins/serviceaffinity:all-srcs",
|
||||||
"//pkg/scheduler/framework/plugins/tainttoleration:all-srcs",
|
"//pkg/scheduler/framework/plugins/tainttoleration:all-srcs",
|
||||||
"//pkg/scheduler/framework/plugins/volumebinding:all-srcs",
|
"//pkg/scheduler/framework/plugins/volumebinding:all-srcs",
|
||||||
|
@ -21,7 +21,6 @@ import (
|
|||||||
|
|
||||||
"k8s.io/klog/v2"
|
"k8s.io/klog/v2"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/apis/config"
|
"k8s.io/kubernetes/pkg/scheduler/apis/config"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpodtopologyspread"
|
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/imagelocality"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/imagelocality"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeaffinity"
|
||||||
@ -33,6 +32,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeunschedulable"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodeunschedulable"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread"
|
||||||
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/selectorspread"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/serviceaffinity"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/serviceaffinity"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding"
|
||||||
@ -345,8 +345,8 @@ func NewLegacyRegistry() *LegacyRegistry {
|
|||||||
// Register Priorities.
|
// Register Priorities.
|
||||||
registry.registerPriorityConfigProducer(SelectorSpreadPriority,
|
registry.registerPriorityConfigProducer(SelectorSpreadPriority,
|
||||||
func(args ConfigProducerArgs) (plugins config.Plugins, pluginConfig []config.PluginConfig) {
|
func(args ConfigProducerArgs) (plugins config.Plugins, pluginConfig []config.PluginConfig) {
|
||||||
plugins.Score = appendToPluginSet(plugins.Score, defaultpodtopologyspread.Name, &args.Weight)
|
plugins.Score = appendToPluginSet(plugins.Score, selectorspread.Name, &args.Weight)
|
||||||
plugins.PreScore = appendToPluginSet(plugins.PreScore, defaultpodtopologyspread.Name, nil)
|
plugins.PreScore = appendToPluginSet(plugins.PreScore, selectorspread.Name, nil)
|
||||||
return
|
return
|
||||||
})
|
})
|
||||||
registry.registerPriorityConfigProducer(TaintTolerationPriority,
|
registry.registerPriorityConfigProducer(TaintTolerationPriority,
|
||||||
|
@ -735,8 +735,8 @@ func BenchmarkTestPodTopologySpreadScore(b *testing.B) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// The following test allows to compare PodTopologySpread.Score with
|
// The following test allows to compare PodTopologySpread.Score with
|
||||||
// DefaultPodTopologySpread.Score by using a similar rule.
|
// SelectorSpread.Score by using a similar rule.
|
||||||
// See pkg/scheduler/framework/plugins/defaultpodtopologyspread/default_pod_topology_spread_perf_test.go
|
// See pkg/scheduler/framework/plugins/selectorspread/selector_spread_perf_test.go
|
||||||
// for the equivalent test.
|
// for the equivalent test.
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -18,7 +18,6 @@ package plugins
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpodtopologyspread"
|
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpreemption"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpreemption"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/imagelocality"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/imagelocality"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/interpodaffinity"
|
||||||
@ -32,6 +31,7 @@ import (
|
|||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodevolumelimits"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/podtopologyspread"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
|
||||||
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/selectorspread"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/serviceaffinity"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/serviceaffinity"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/tainttoleration"
|
||||||
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding"
|
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding"
|
||||||
@ -45,7 +45,7 @@ import (
|
|||||||
// through the WithFrameworkOutOfTreeRegistry option.
|
// through the WithFrameworkOutOfTreeRegistry option.
|
||||||
func NewInTreeRegistry() runtime.Registry {
|
func NewInTreeRegistry() runtime.Registry {
|
||||||
return runtime.Registry{
|
return runtime.Registry{
|
||||||
defaultpodtopologyspread.Name: defaultpodtopologyspread.New,
|
selectorspread.Name: selectorspread.New,
|
||||||
imagelocality.Name: imagelocality.New,
|
imagelocality.Name: imagelocality.New,
|
||||||
tainttoleration.Name: tainttoleration.New,
|
tainttoleration.Name: tainttoleration.New,
|
||||||
nodename.Name: nodename.New,
|
nodename.Name: nodename.New,
|
||||||
|
@ -2,8 +2,8 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
|||||||
|
|
||||||
go_library(
|
go_library(
|
||||||
name = "go_default_library",
|
name = "go_default_library",
|
||||||
srcs = ["default_pod_topology_spread.go"],
|
srcs = ["selector_spread.go"],
|
||||||
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultpodtopologyspread",
|
importpath = "k8s.io/kubernetes/pkg/scheduler/framework/plugins/selectorspread",
|
||||||
visibility = ["//visibility:public"],
|
visibility = ["//visibility:public"],
|
||||||
deps = [
|
deps = [
|
||||||
"//pkg/scheduler/framework/plugins/helper:go_default_library",
|
"//pkg/scheduler/framework/plugins/helper:go_default_library",
|
||||||
@ -18,8 +18,8 @@ go_library(
|
|||||||
go_test(
|
go_test(
|
||||||
name = "go_default_test",
|
name = "go_default_test",
|
||||||
srcs = [
|
srcs = [
|
||||||
"default_pod_topology_spread_perf_test.go",
|
"selector_spread_perf_test.go",
|
||||||
"default_pod_topology_spread_test.go",
|
"selector_spread_test.go",
|
||||||
],
|
],
|
||||||
embed = [":go_default_library"],
|
embed = [":go_default_library"],
|
||||||
deps = [
|
deps = [
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package defaultpodtopologyspread
|
package selectorspread
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -28,18 +28,18 @@ import (
|
|||||||
utilnode "k8s.io/kubernetes/pkg/util/node"
|
utilnode "k8s.io/kubernetes/pkg/util/node"
|
||||||
)
|
)
|
||||||
|
|
||||||
// DefaultPodTopologySpread is a plugin that calculates selector spread priority.
|
// SelectorSpread is a plugin that calculates selector spread priority.
|
||||||
type DefaultPodTopologySpread struct {
|
type SelectorSpread struct {
|
||||||
handle framework.FrameworkHandle
|
handle framework.FrameworkHandle
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ framework.PreScorePlugin = &DefaultPodTopologySpread{}
|
var _ framework.PreScorePlugin = &SelectorSpread{}
|
||||||
var _ framework.ScorePlugin = &DefaultPodTopologySpread{}
|
var _ framework.ScorePlugin = &SelectorSpread{}
|
||||||
|
|
||||||
const (
|
const (
|
||||||
// Name is the name of the plugin used in the plugin registry and configurations.
|
// Name is the name of the plugin used in the plugin registry and configurations.
|
||||||
Name = "DefaultPodTopologySpread"
|
Name = "SelectorSpread"
|
||||||
// preScoreStateKey is the key in CycleState to DefaultPodTopologySpread pre-computed data for Scoring.
|
// preScoreStateKey is the key in CycleState to SelectorSpread pre-computed data for Scoring.
|
||||||
preScoreStateKey = "PreScore" + Name
|
preScoreStateKey = "PreScore" + Name
|
||||||
|
|
||||||
// When zone information is present, give 2/3 of the weighting to zone spreading, 1/3 to node spreading
|
// When zone information is present, give 2/3 of the weighting to zone spreading, 1/3 to node spreading
|
||||||
@ -48,7 +48,7 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Name returns name of the plugin. It is used in logs, etc.
|
// Name returns name of the plugin. It is used in logs, etc.
|
||||||
func (pl *DefaultPodTopologySpread) Name() string {
|
func (pl *SelectorSpread) Name() string {
|
||||||
return Name
|
return Name
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -63,18 +63,18 @@ func (s *preScoreState) Clone() framework.StateData {
|
|||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
||||||
// skipDefaultPodTopologySpread returns true if the pod's TopologySpreadConstraints are specified.
|
// skipSelectorSpread returns true if the pod's TopologySpreadConstraints are specified.
|
||||||
// Note that this doesn't take into account default constraints defined for
|
// Note that this doesn't take into account default constraints defined for
|
||||||
// the PodTopologySpread plugin.
|
// the PodTopologySpread plugin.
|
||||||
func skipDefaultPodTopologySpread(pod *v1.Pod) bool {
|
func skipSelectorSpread(pod *v1.Pod) bool {
|
||||||
return len(pod.Spec.TopologySpreadConstraints) != 0
|
return len(pod.Spec.TopologySpreadConstraints) != 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// Score invoked at the Score extension point.
|
// 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 matching number of pods on the `nodeName`,
|
||||||
// it is normalized later.
|
// it is normalized later.
|
||||||
func (pl *DefaultPodTopologySpread) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) {
|
func (pl *SelectorSpread) Score(ctx context.Context, state *framework.CycleState, pod *v1.Pod, nodeName string) (int64, *framework.Status) {
|
||||||
if skipDefaultPodTopologySpread(pod) {
|
if skipSelectorSpread(pod) {
|
||||||
return 0, nil
|
return 0, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,8 +102,8 @@ func (pl *DefaultPodTopologySpread) Score(ctx context.Context, state *framework.
|
|||||||
// based on the number of existing matching pods on the node
|
// based on the number of existing matching pods on the node
|
||||||
// where zone information is included on the nodes, it favors nodes
|
// where zone information is included on the nodes, it favors nodes
|
||||||
// in zones with fewer existing matching pods.
|
// in zones with fewer existing matching pods.
|
||||||
func (pl *DefaultPodTopologySpread) NormalizeScore(ctx context.Context, state *framework.CycleState, pod *v1.Pod, scores framework.NodeScoreList) *framework.Status {
|
func (pl *SelectorSpread) NormalizeScore(ctx context.Context, state *framework.CycleState, pod *v1.Pod, scores framework.NodeScoreList) *framework.Status {
|
||||||
if skipDefaultPodTopologySpread(pod) {
|
if skipSelectorSpread(pod) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,13 +166,13 @@ func (pl *DefaultPodTopologySpread) NormalizeScore(ctx context.Context, state *f
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ScoreExtensions of the Score plugin.
|
// ScoreExtensions of the Score plugin.
|
||||||
func (pl *DefaultPodTopologySpread) ScoreExtensions() framework.ScoreExtensions {
|
func (pl *SelectorSpread) ScoreExtensions() framework.ScoreExtensions {
|
||||||
return pl
|
return pl
|
||||||
}
|
}
|
||||||
|
|
||||||
// PreScore builds and writes cycle state used by Score and NormalizeScore.
|
// PreScore builds and writes cycle state used by Score and NormalizeScore.
|
||||||
func (pl *DefaultPodTopologySpread) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*v1.Node) *framework.Status {
|
func (pl *SelectorSpread) PreScore(ctx context.Context, cycleState *framework.CycleState, pod *v1.Pod, nodes []*v1.Node) *framework.Status {
|
||||||
if skipDefaultPodTopologySpread(pod) {
|
if skipSelectorSpread(pod) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
var selector labels.Selector
|
var selector labels.Selector
|
||||||
@ -193,7 +193,7 @@ func (pl *DefaultPodTopologySpread) PreScore(ctx context.Context, cycleState *fr
|
|||||||
|
|
||||||
// New initializes a new plugin and returns it.
|
// New initializes a new plugin and returns it.
|
||||||
func New(_ runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error) {
|
func New(_ runtime.Object, handle framework.FrameworkHandle) (framework.Plugin, error) {
|
||||||
return &DefaultPodTopologySpread{
|
return &SelectorSpread{
|
||||||
handle: handle,
|
handle: handle,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package defaultpodtopologyspread
|
package selectorspread
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -69,7 +69,7 @@ func BenchmarkTestSelectorSpreadPriority(b *testing.B) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
fh, _ := runtime.NewFramework(nil, nil, nil, runtime.WithSnapshotSharedLister(snapshot), runtime.WithInformerFactory(informerFactory))
|
fh, _ := runtime.NewFramework(nil, nil, nil, runtime.WithSnapshotSharedLister(snapshot), runtime.WithInformerFactory(informerFactory))
|
||||||
plugin := &DefaultPodTopologySpread{handle: fh}
|
plugin := &SelectorSpread{handle: fh}
|
||||||
b.ResetTimer()
|
b.ResetTimer()
|
||||||
|
|
||||||
for i := 0; i < b.N; i++ {
|
for i := 0; i < b.N; i++ {
|
@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
|
|||||||
limitations under the License.
|
limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package defaultpodtopologyspread
|
package selectorspread
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
@ -43,7 +43,7 @@ func controllerRef(kind, name, uid string) []metav1.OwnerReference {
|
|||||||
//}
|
//}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDefaultPodTopologySpreadScore(t *testing.T) {
|
func TestSelectorSpreadScore(t *testing.T) {
|
||||||
labels1 := map[string]string{
|
labels1 := map[string]string{
|
||||||
"foo": "bar",
|
"foo": "bar",
|
||||||
"baz": "blah",
|
"baz": "blah",
|
||||||
@ -383,7 +383,7 @@ func TestDefaultPodTopologySpreadScore(t *testing.T) {
|
|||||||
|
|
||||||
state := framework.NewCycleState()
|
state := framework.NewCycleState()
|
||||||
|
|
||||||
plugin := &DefaultPodTopologySpread{
|
plugin := &SelectorSpread{
|
||||||
handle: fh,
|
handle: fh,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -635,7 +635,7 @@ func TestZoneSelectorSpreadPriority(t *testing.T) {
|
|||||||
t.Errorf("error creating new framework handle: %+v", err)
|
t.Errorf("error creating new framework handle: %+v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin := &DefaultPodTopologySpread{
|
plugin := &SelectorSpread{
|
||||||
handle: fh,
|
handle: fh,
|
||||||
}
|
}
|
||||||
|
|
@ -130,7 +130,7 @@ func TestSchedulerCreationFromConfigMap(t *testing.T) {
|
|||||||
"PreScorePlugin": {
|
"PreScorePlugin": {
|
||||||
{Name: "PodTopologySpread"},
|
{Name: "PodTopologySpread"},
|
||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
@ -141,7 +141,7 @@ func TestSchedulerCreationFromConfigMap(t *testing.T) {
|
|||||||
{Name: "NodeResourcesLeastAllocated", Weight: 1},
|
{Name: "NodeResourcesLeastAllocated", Weight: 1},
|
||||||
{Name: "NodeAffinity", Weight: 1},
|
{Name: "NodeAffinity", Weight: 1},
|
||||||
{Name: "NodePreferAvoidPods", Weight: 10000},
|
{Name: "NodePreferAvoidPods", Weight: 10000},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 1},
|
{Name: "SelectorSpread", Weight: 1},
|
||||||
{Name: "TaintToleration", Weight: 1},
|
{Name: "TaintToleration", Weight: 1},
|
||||||
},
|
},
|
||||||
"ReservePlugin": {{Name: "VolumeBinding"}},
|
"ReservePlugin": {{Name: "VolumeBinding"}},
|
||||||
@ -223,7 +223,7 @@ kind: Policy
|
|||||||
"PreScorePlugin": {
|
"PreScorePlugin": {
|
||||||
{Name: "PodTopologySpread"},
|
{Name: "PodTopologySpread"},
|
||||||
{Name: "InterPodAffinity"},
|
{Name: "InterPodAffinity"},
|
||||||
{Name: "DefaultPodTopologySpread"},
|
{Name: "SelectorSpread"},
|
||||||
{Name: "TaintToleration"},
|
{Name: "TaintToleration"},
|
||||||
},
|
},
|
||||||
"ScorePlugin": {
|
"ScorePlugin": {
|
||||||
@ -234,7 +234,7 @@ kind: Policy
|
|||||||
{Name: "NodeResourcesLeastAllocated", Weight: 1},
|
{Name: "NodeResourcesLeastAllocated", Weight: 1},
|
||||||
{Name: "NodeAffinity", Weight: 1},
|
{Name: "NodeAffinity", Weight: 1},
|
||||||
{Name: "NodePreferAvoidPods", Weight: 10000},
|
{Name: "NodePreferAvoidPods", Weight: 10000},
|
||||||
{Name: "DefaultPodTopologySpread", Weight: 1},
|
{Name: "SelectorSpread", Weight: 1},
|
||||||
{Name: "TaintToleration", Weight: 1},
|
{Name: "TaintToleration", Weight: 1},
|
||||||
},
|
},
|
||||||
"ReservePlugin": {{Name: "VolumeBinding"}},
|
"ReservePlugin": {{Name: "VolumeBinding"}},
|
||||||
|
Loading…
Reference in New Issue
Block a user