Merge pull request #96426 from damemi/print-scheduler-config
Log defaulted kube-scheduler component config at startup
This commit is contained in:
@@ -1593,6 +1593,48 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
|
||||
"PreBindPlugin": {{Name: "VolumeBinding"}},
|
||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||
}
|
||||
defaultPluginConfigs := []config.PluginConfig{
|
||||
{
|
||||
Name: "DefaultPreemption",
|
||||
Args: &config.DefaultPreemptionArgs{
|
||||
MinCandidateNodesPercentage: 10,
|
||||
MinCandidateNodesAbsolute: 100,
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "InterPodAffinity",
|
||||
Args: &config.InterPodAffinityArgs{
|
||||
HardPodAffinityWeight: 1,
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "NodeAffinity",
|
||||
Args: &config.NodeAffinityArgs{},
|
||||
},
|
||||
{
|
||||
Name: "NodeResourcesFit",
|
||||
Args: &config.NodeResourcesFitArgs{},
|
||||
},
|
||||
{
|
||||
Name: "NodeResourcesLeastAllocated",
|
||||
Args: &config.NodeResourcesLeastAllocatedArgs{
|
||||
Resources: []config.ResourceSpec{
|
||||
{Name: "cpu", Weight: 1},
|
||||
{Name: "memory", Weight: 1},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "PodTopologySpread",
|
||||
Args: &config.PodTopologySpreadArgs{DefaultingType: config.SystemDefaulting},
|
||||
},
|
||||
{
|
||||
Name: "VolumeBinding",
|
||||
Args: &config.VolumeBindingArgs{
|
||||
BindTimeoutSeconds: 600,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
testcases := []struct {
|
||||
name string
|
||||
@@ -1604,11 +1646,76 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
|
||||
{
|
||||
name: "default plugins",
|
||||
wantPlugins: defaultPlugins,
|
||||
wantPluginConfig: nil,
|
||||
wantPluginConfig: defaultPluginConfigs,
|
||||
},
|
||||
{
|
||||
name: "default plugins with customized plugin config",
|
||||
wantPlugins: defaultPlugins,
|
||||
name: "in-tree plugins with customized plugin config",
|
||||
plugins: config.Plugins{
|
||||
Filter: &config.PluginSet{
|
||||
Enabled: []config.Plugin{
|
||||
{Name: "NodeLabel"},
|
||||
{Name: "ServiceAffinity"},
|
||||
},
|
||||
},
|
||||
Score: &config.PluginSet{
|
||||
Enabled: []config.Plugin{
|
||||
{Name: "RequestedToCapacityRatio"},
|
||||
},
|
||||
},
|
||||
},
|
||||
wantPlugins: map[string][]config.Plugin{
|
||||
"QueueSortPlugin": {
|
||||
{Name: "PrioritySort"},
|
||||
},
|
||||
"PreFilterPlugin": {
|
||||
{Name: "NodeResourcesFit"},
|
||||
{Name: "NodePorts"},
|
||||
{Name: "PodTopologySpread"},
|
||||
{Name: "InterPodAffinity"},
|
||||
{Name: "VolumeBinding"},
|
||||
},
|
||||
"FilterPlugin": {
|
||||
{Name: "NodeUnschedulable"},
|
||||
{Name: "NodeName"},
|
||||
{Name: "TaintToleration"},
|
||||
{Name: "NodeAffinity"},
|
||||
{Name: "NodePorts"},
|
||||
{Name: "NodeResourcesFit"},
|
||||
{Name: "VolumeRestrictions"},
|
||||
{Name: "EBSLimits"},
|
||||
{Name: "GCEPDLimits"},
|
||||
{Name: "NodeVolumeLimits"},
|
||||
{Name: "AzureDiskLimits"},
|
||||
{Name: "VolumeBinding"},
|
||||
{Name: "VolumeZone"},
|
||||
{Name: "PodTopologySpread"},
|
||||
{Name: "InterPodAffinity"},
|
||||
{Name: "NodeLabel"},
|
||||
{Name: "ServiceAffinity"},
|
||||
},
|
||||
"PostFilterPlugin": {
|
||||
{Name: "DefaultPreemption"},
|
||||
},
|
||||
"PreScorePlugin": {
|
||||
{Name: "InterPodAffinity"},
|
||||
{Name: "PodTopologySpread"},
|
||||
{Name: "TaintToleration"},
|
||||
},
|
||||
"ScorePlugin": {
|
||||
{Name: "NodeResourcesBalancedAllocation", Weight: 1},
|
||||
{Name: "ImageLocality", Weight: 1},
|
||||
{Name: "InterPodAffinity", Weight: 1},
|
||||
{Name: "NodeResourcesLeastAllocated", Weight: 1},
|
||||
{Name: "NodeAffinity", Weight: 1},
|
||||
{Name: "NodePreferAvoidPods", Weight: 10000},
|
||||
{Name: "PodTopologySpread", Weight: 2},
|
||||
{Name: "TaintToleration", Weight: 1},
|
||||
{Name: "RequestedToCapacityRatio", Weight: 1},
|
||||
},
|
||||
"ReservePlugin": {{Name: "VolumeBinding"}},
|
||||
"PreBindPlugin": {{Name: "VolumeBinding"}},
|
||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||
},
|
||||
pluginConfig: []config.PluginConfig{
|
||||
{
|
||||
Name: "NodeResourcesFit",
|
||||
@@ -1675,12 +1782,47 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
|
||||
},
|
||||
},
|
||||
wantPluginConfig: []config.PluginConfig{
|
||||
{
|
||||
Name: "DefaultPreemption",
|
||||
Args: &config.DefaultPreemptionArgs{
|
||||
MinCandidateNodesPercentage: 10,
|
||||
MinCandidateNodesAbsolute: 100,
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "InterPodAffinity",
|
||||
Args: &config.InterPodAffinityArgs{
|
||||
HardPodAffinityWeight: 100,
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "NodeAffinity",
|
||||
Args: &config.NodeAffinityArgs{},
|
||||
},
|
||||
{
|
||||
Name: "NodeLabel",
|
||||
Args: &config.NodeLabelArgs{
|
||||
PresentLabels: []string{"foo", "bar"},
|
||||
AbsentLabels: []string{"apple"},
|
||||
PresentLabelsPreference: []string{"dog"},
|
||||
AbsentLabelsPreference: []string{"cat"},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "NodeResourcesFit",
|
||||
Args: &config.NodeResourcesFitArgs{
|
||||
IgnoredResources: []string{"foo", "bar"},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "NodeResourcesLeastAllocated",
|
||||
Args: &config.NodeResourcesLeastAllocatedArgs{
|
||||
Resources: []config.ResourceSpec{
|
||||
{Name: "cpu", Weight: 1},
|
||||
{Name: "memory", Weight: 1},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "PodTopologySpread",
|
||||
Args: &config.PodTopologySpreadArgs{
|
||||
@@ -1710,21 +1852,6 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "InterPodAffinity",
|
||||
Args: &config.InterPodAffinityArgs{
|
||||
HardPodAffinityWeight: 100,
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "NodeLabel",
|
||||
Args: &config.NodeLabelArgs{
|
||||
PresentLabels: []string{"foo", "bar"},
|
||||
AbsentLabels: []string{"apple"},
|
||||
PresentLabelsPreference: []string{"dog"},
|
||||
AbsentLabelsPreference: []string{"cat"},
|
||||
},
|
||||
},
|
||||
{
|
||||
Name: "ServiceAffinity",
|
||||
Args: &config.ServiceAffinityArgs{
|
||||
@@ -1864,6 +1991,7 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
|
||||
},
|
||||
PreScore: &config.PluginSet{
|
||||
Enabled: []config.Plugin{
|
||||
{Name: "PodTopologySpread"},
|
||||
{Name: "TaintToleration"},
|
||||
{Name: "SelectorSpread"},
|
||||
{Name: "InterPodAffinity"},
|
||||
@@ -1874,6 +2002,7 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
|
||||
},
|
||||
Score: &config.PluginSet{
|
||||
Enabled: []config.Plugin{
|
||||
{Name: "PodTopologySpread", Weight: 24},
|
||||
{Name: "TaintToleration", Weight: 24},
|
||||
{Name: "SelectorSpread", Weight: 24},
|
||||
{Name: "NodePreferAvoidPods", Weight: 24},
|
||||
@@ -1921,11 +2050,13 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
|
||||
{Name: "DefaultPreemption"},
|
||||
},
|
||||
"PreScorePlugin": {
|
||||
{Name: "PodTopologySpread"},
|
||||
{Name: "TaintToleration"},
|
||||
{Name: "SelectorSpread"},
|
||||
{Name: "InterPodAffinity"},
|
||||
},
|
||||
"ScorePlugin": {
|
||||
{Name: "PodTopologySpread", Weight: 24},
|
||||
{Name: "TaintToleration", Weight: 24},
|
||||
{Name: "SelectorSpread", Weight: 24},
|
||||
{Name: "NodePreferAvoidPods", Weight: 24},
|
||||
@@ -1939,7 +2070,7 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
|
||||
"PreBindPlugin": {{Name: "VolumeBinding"}},
|
||||
"BindPlugin": {{Name: "DefaultBinder"}},
|
||||
},
|
||||
wantPluginConfig: nil,
|
||||
wantPluginConfig: defaultPluginConfigs,
|
||||
},
|
||||
}
|
||||
for _, tc := range testcases {
|
||||
|
Reference in New Issue
Block a user