Skip to content

Commit 1ff09c0

Browse files
committed
Remove BindTimeoutSeconds from KubeSchedulerConfiguration
1 parent 367f75e commit 1ff09c0

File tree

15 files changed

+26
-233
lines changed

15 files changed

+26
-233
lines changed

cmd/kube-scheduler/app/options/options_test.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ profiles:
247247
}
248248

249249
defaultSource := "DefaultProvider"
250-
defaultBindTimeoutSeconds := int64(600)
251250
defaultPodInitialBackoffSeconds := int64(1)
252251
defaultPodMaxBackoffSeconds := int64(10)
253252
defaultPercentageOfNodesToScore := int32(0)
@@ -320,7 +319,6 @@ profiles:
320319
ContentType: "application/vnd.kubernetes.protobuf",
321320
},
322321
PercentageOfNodesToScore: defaultPercentageOfNodesToScore,
323-
BindTimeoutSeconds: defaultBindTimeoutSeconds,
324322
PodInitialBackoffSeconds: defaultPodInitialBackoffSeconds,
325323
PodMaxBackoffSeconds: defaultPodMaxBackoffSeconds,
326324
Profiles: []kubeschedulerconfig.KubeSchedulerProfile{
@@ -410,7 +408,6 @@ profiles:
410408
ContentType: "application/vnd.kubernetes.protobuf",
411409
},
412410
PercentageOfNodesToScore: defaultPercentageOfNodesToScore,
413-
BindTimeoutSeconds: defaultBindTimeoutSeconds,
414411
PodInitialBackoffSeconds: defaultPodInitialBackoffSeconds,
415412
PodMaxBackoffSeconds: defaultPodMaxBackoffSeconds,
416413
Profiles: []kubeschedulerconfig.KubeSchedulerProfile{
@@ -474,7 +471,6 @@ profiles:
474471
ContentType: "application/vnd.kubernetes.protobuf",
475472
},
476473
PercentageOfNodesToScore: defaultPercentageOfNodesToScore,
477-
BindTimeoutSeconds: defaultBindTimeoutSeconds,
478474
PodInitialBackoffSeconds: defaultPodInitialBackoffSeconds,
479475
PodMaxBackoffSeconds: defaultPodMaxBackoffSeconds,
480476
Profiles: []kubeschedulerconfig.KubeSchedulerProfile{
@@ -513,7 +509,6 @@ profiles:
513509
ContentType: "application/vnd.kubernetes.protobuf",
514510
},
515511
PercentageOfNodesToScore: defaultPercentageOfNodesToScore,
516-
BindTimeoutSeconds: defaultBindTimeoutSeconds,
517512
PodInitialBackoffSeconds: defaultPodInitialBackoffSeconds,
518513
PodMaxBackoffSeconds: defaultPodMaxBackoffSeconds,
519514
Profiles: []kubeschedulerconfig.KubeSchedulerProfile{
@@ -587,7 +582,6 @@ profiles:
587582
ContentType: "application/vnd.kubernetes.protobuf",
588583
},
589584
PercentageOfNodesToScore: defaultPercentageOfNodesToScore,
590-
BindTimeoutSeconds: defaultBindTimeoutSeconds,
591585
PodInitialBackoffSeconds: defaultPodInitialBackoffSeconds,
592586
PodMaxBackoffSeconds: defaultPodMaxBackoffSeconds,
593587
Profiles: []kubeschedulerconfig.KubeSchedulerProfile{
@@ -659,7 +653,6 @@ profiles:
659653
ContentType: "application/vnd.kubernetes.protobuf",
660654
},
661655
PercentageOfNodesToScore: defaultPercentageOfNodesToScore,
662-
BindTimeoutSeconds: defaultBindTimeoutSeconds,
663656
PodInitialBackoffSeconds: defaultPodInitialBackoffSeconds,
664657
PodMaxBackoffSeconds: defaultPodMaxBackoffSeconds,
665658
Profiles: []kubeschedulerconfig.KubeSchedulerProfile{
@@ -711,7 +704,6 @@ profiles:
711704
ContentType: "application/vnd.kubernetes.protobuf",
712705
},
713706
PercentageOfNodesToScore: defaultPercentageOfNodesToScore,
714-
BindTimeoutSeconds: defaultBindTimeoutSeconds,
715707
PodInitialBackoffSeconds: defaultPodInitialBackoffSeconds,
716708
PodMaxBackoffSeconds: defaultPodMaxBackoffSeconds,
717709
Profiles: []kubeschedulerconfig.KubeSchedulerProfile{

cmd/kube-scheduler/app/server.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,6 @@ func Setup(ctx context.Context, opts *options.Options, outOfTreeRegistryOptions
337337
scheduler.WithAlgorithmSource(cc.ComponentConfig.AlgorithmSource),
338338
scheduler.WithPreemptionDisabled(cc.ComponentConfig.DisablePreemption),
339339
scheduler.WithPercentageOfNodesToScore(cc.ComponentConfig.PercentageOfNodesToScore),
340-
scheduler.WithBindTimeoutSeconds(cc.ComponentConfig.BindTimeoutSeconds),
341340
scheduler.WithFrameworkOutOfTreeRegistry(outOfTreeRegistry),
342341
scheduler.WithPodMaxBackoffSeconds(cc.ComponentConfig.PodMaxBackoffSeconds),
343342
scheduler.WithPodInitialBackoffSeconds(cc.ComponentConfig.PodInitialBackoffSeconds),

pkg/scheduler/apis/config/scheme/scheme_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,6 @@ profiles:
478478
},
479479
},
480480
want: `apiVersion: kubescheduler.config.k8s.io/v1beta1
481-
bindTimeoutSeconds: 0
482481
clientConnection:
483482
acceptContentTypes: ""
484483
burst: 0

pkg/scheduler/apis/config/testing/compatibility_test.go

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1617,15 +1617,6 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
16171617
"PostBindPlugin": {{Name: "VolumeBinding"}},
16181618
}
16191619

1620-
defaultPluginConfigs := []config.PluginConfig{
1621-
{
1622-
Name: "VolumeBinding",
1623-
Args: &config.VolumeBindingArgs{
1624-
BindTimeoutSeconds: 600,
1625-
},
1626-
},
1627-
}
1628-
16291620
testcases := []struct {
16301621
name string
16311622
plugins config.Plugins
@@ -1636,7 +1627,7 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
16361627
{
16371628
name: "default plugins",
16381629
wantPlugins: defaultPlugins,
1639-
wantPluginConfig: defaultPluginConfigs,
1630+
wantPluginConfig: nil,
16401631
},
16411632
{
16421633
name: "default plugins with customized plugin config",
@@ -1967,7 +1958,7 @@ func TestPluginsConfigurationCompatibility(t *testing.T) {
19671958
"BindPlugin": {{Name: "DefaultBinder"}},
19681959
"PostBindPlugin": {{Name: "VolumeBinding"}},
19691960
},
1970-
wantPluginConfig: defaultPluginConfigs,
1961+
wantPluginConfig: nil,
19711962
},
19721963
}
19731964
for _, tc := range testcases {

pkg/scheduler/apis/config/types.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,13 +90,6 @@ type KubeSchedulerConfiguration struct {
9090
// nodes will be scored.
9191
PercentageOfNodesToScore int32
9292

93-
// BindTimeoutSeconds is the timeout in seconds in volume binding operation.
94-
// Value must be non-negative integer. The value zero indicates no waiting.
95-
// If this value is nil, the default value will be used.
96-
// DEPRECATED: BindTimeoutSeconds in deprecated.
97-
// TODO(#90958) Remove this and the versioned counterparts in future API versions.
98-
BindTimeoutSeconds int64
99-
10093
// PodInitialBackoffSeconds is the initial backoff for unschedulable pods.
10194
// If specified, it must be greater than 0. If this value is null, the default value (1s)
10295
// will be used.

pkg/scheduler/apis/config/v1beta1/defaults.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,6 @@ func SetDefaults_KubeSchedulerConfiguration(obj *v1beta1.KubeSchedulerConfigurat
135135
// Use the default LeaderElectionConfiguration options
136136
componentbaseconfigv1alpha1.RecommendedDefaultLeaderElectionConfiguration(&obj.LeaderElection)
137137

138-
if obj.BindTimeoutSeconds == nil {
139-
val := int64(600)
140-
obj.BindTimeoutSeconds = &val
141-
}
142-
143138
if obj.PodInitialBackoffSeconds == nil {
144139
val := int64(1)
145140
obj.PodInitialBackoffSeconds = &val

pkg/scheduler/apis/config/v1beta1/defaults_test.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@ func TestSchedulerDefaults(t *testing.T) {
6262
},
6363
DisablePreemption: pointer.BoolPtr(false),
6464
PercentageOfNodesToScore: pointer.Int32Ptr(0),
65-
BindTimeoutSeconds: pointer.Int64Ptr(600),
6665
PodInitialBackoffSeconds: pointer.Int64Ptr(1),
6766
PodMaxBackoffSeconds: pointer.Int64Ptr(10),
6867
Profiles: []v1beta1.KubeSchedulerProfile{
@@ -104,7 +103,6 @@ func TestSchedulerDefaults(t *testing.T) {
104103
},
105104
DisablePreemption: pointer.BoolPtr(false),
106105
PercentageOfNodesToScore: pointer.Int32Ptr(0),
107-
BindTimeoutSeconds: pointer.Int64Ptr(600),
108106
PodInitialBackoffSeconds: pointer.Int64Ptr(1),
109107
PodMaxBackoffSeconds: pointer.Int64Ptr(10),
110108
Profiles: []v1beta1.KubeSchedulerProfile{
@@ -161,7 +159,6 @@ func TestSchedulerDefaults(t *testing.T) {
161159
},
162160
DisablePreemption: pointer.BoolPtr(false),
163161
PercentageOfNodesToScore: pointer.Int32Ptr(0),
164-
BindTimeoutSeconds: pointer.Int64Ptr(600),
165162
PodInitialBackoffSeconds: pointer.Int64Ptr(1),
166163
PodMaxBackoffSeconds: pointer.Int64Ptr(10),
167164
Profiles: []v1beta1.KubeSchedulerProfile{
@@ -212,7 +209,6 @@ func TestSchedulerDefaults(t *testing.T) {
212209
},
213210
DisablePreemption: pointer.BoolPtr(false),
214211
PercentageOfNodesToScore: pointer.Int32Ptr(0),
215-
BindTimeoutSeconds: pointer.Int64Ptr(600),
216212
PodInitialBackoffSeconds: pointer.Int64Ptr(1),
217213
PodMaxBackoffSeconds: pointer.Int64Ptr(10),
218214
Profiles: []v1beta1.KubeSchedulerProfile{
@@ -249,7 +245,6 @@ func TestSchedulerDefaults(t *testing.T) {
249245
},
250246
DisablePreemption: pointer.BoolPtr(false),
251247
PercentageOfNodesToScore: pointer.Int32Ptr(0),
252-
BindTimeoutSeconds: pointer.Int64Ptr(600),
253248
PodInitialBackoffSeconds: pointer.Int64Ptr(1),
254249
PodMaxBackoffSeconds: pointer.Int64Ptr(10),
255250
Profiles: []v1beta1.KubeSchedulerProfile{

pkg/scheduler/apis/config/validation/validation_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import (
2828
)
2929

3030
func TestValidateKubeSchedulerConfiguration(t *testing.T) {
31-
testTimeout := int64(0)
3231
podInitialBackoffSeconds := int64(1)
3332
podMaxBackoffSeconds := int64(1)
3433
validConfig := &config.KubeSchedulerConfiguration{
@@ -59,7 +58,6 @@ func TestValidateKubeSchedulerConfiguration(t *testing.T) {
5958
},
6059
PodInitialBackoffSeconds: podInitialBackoffSeconds,
6160
PodMaxBackoffSeconds: podMaxBackoffSeconds,
62-
BindTimeoutSeconds: testTimeout,
6361
PercentageOfNodesToScore: 35,
6462
Profiles: []config.KubeSchedulerProfile{
6563
{

pkg/scheduler/factory.go

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ import (
4848
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/defaultbinder"
4949
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/noderesources"
5050
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
51-
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding"
5251
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
5352
internalcache "k8s.io/kubernetes/pkg/scheduler/internal/cache"
5453
cachedebugger "k8s.io/kubernetes/pkg/scheduler/internal/cache/debugger"
@@ -86,8 +85,6 @@ type Configurator struct {
8685
// percentageOfNodesToScore specifies percentage of all nodes to score in each scheduling cycle.
8786
percentageOfNodesToScore int32
8887

89-
bindTimeoutSeconds int64
90-
9188
podInitialBackoffSeconds int64
9289

9390
podMaxBackoffSeconds int64
@@ -212,26 +209,6 @@ func (c *Configurator) create() (*Scheduler, error) {
212209
}, nil
213210
}
214211

215-
func maybeAppendVolumeBindingArgs(plugins *schedulerapi.Plugins, pcs []schedulerapi.PluginConfig, config schedulerapi.PluginConfig) []schedulerapi.PluginConfig {
216-
enabled := false
217-
for _, p := range plugins.PreBind.Enabled {
218-
if p.Name == volumebinding.Name {
219-
enabled = true
220-
}
221-
}
222-
if !enabled {
223-
// skip if VolumeBinding is not enabled
224-
return pcs
225-
}
226-
// append if not exist
227-
for _, pc := range pcs {
228-
if pc.Name == config.Name {
229-
return pcs
230-
}
231-
}
232-
return append(pcs, config)
233-
}
234-
235212
// createFromProvider creates a scheduler from the name of a registered algorithm provider.
236213
func (c *Configurator) createFromProvider(providerName string) (*Scheduler, error) {
237214
klog.V(2).Infof("Creating scheduler from algorithm provider '%v'", providerName)
@@ -247,12 +224,6 @@ func (c *Configurator) createFromProvider(providerName string) (*Scheduler, erro
247224
plugins.Append(defaultPlugins)
248225
plugins.Apply(prof.Plugins)
249226
prof.Plugins = plugins
250-
prof.PluginConfig = maybeAppendVolumeBindingArgs(prof.Plugins, prof.PluginConfig, schedulerapi.PluginConfig{
251-
Name: volumebinding.Name,
252-
Args: &schedulerapi.VolumeBindingArgs{
253-
BindTimeoutSeconds: c.bindTimeoutSeconds,
254-
},
255-
})
256227
}
257228
return c.create()
258229
}
@@ -348,12 +319,6 @@ func (c *Configurator) createFromConfig(policy schedulerapi.Policy) (*Scheduler,
348319

349320
// PluginConfig is ignored when using Policy.
350321
prof.PluginConfig = defPluginConfig
351-
prof.PluginConfig = maybeAppendVolumeBindingArgs(prof.Plugins, prof.PluginConfig, schedulerapi.PluginConfig{
352-
Name: volumebinding.Name,
353-
Args: &schedulerapi.VolumeBindingArgs{
354-
BindTimeoutSeconds: c.bindTimeoutSeconds,
355-
},
356-
})
357322
}
358323

359324
return c.create()

pkg/scheduler/factory_test.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import (
3636
"k8s.io/client-go/tools/events"
3737
extenderv1 "k8s.io/kube-scheduler/extender/v1"
3838
apicore "k8s.io/kubernetes/pkg/apis/core"
39-
"k8s.io/kubernetes/pkg/scheduler/apis/config"
4039
schedulerapi "k8s.io/kubernetes/pkg/scheduler/apis/config"
4140
"k8s.io/kubernetes/pkg/scheduler/apis/config/scheme"
4241
frameworkplugins "k8s.io/kubernetes/pkg/scheduler/framework/plugins"
@@ -45,7 +44,6 @@ import (
4544
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/nodelabel"
4645
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/queuesort"
4746
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/serviceaffinity"
48-
"k8s.io/kubernetes/pkg/scheduler/framework/plugins/volumebinding"
4947
framework "k8s.io/kubernetes/pkg/scheduler/framework/v1alpha1"
5048
internalcache "k8s.io/kubernetes/pkg/scheduler/internal/cache"
5149
internalqueue "k8s.io/kubernetes/pkg/scheduler/internal/queue"
@@ -54,7 +52,6 @@ import (
5452

5553
const (
5654
disablePodPreemption = false
57-
bindTimeoutSeconds = 600
5855
podInitialBackoffDurationSeconds = 1
5956
podMaxBackoffDurationSeconds = 10
6057
testSchedulerName = "test-scheduler"
@@ -242,14 +239,7 @@ func TestCreateFromEmptyConfig(t *testing.T) {
242239
t.Fatal(err)
243240
}
244241
prof := factory.profiles[0]
245-
wantConfig := []schedulerapi.PluginConfig{
246-
{
247-
Name: volumebinding.Name,
248-
Args: &config.VolumeBindingArgs{
249-
BindTimeoutSeconds: bindTimeoutSeconds,
250-
},
251-
},
252-
}
242+
wantConfig := []schedulerapi.PluginConfig{}
253243
if diff := cmp.Diff(wantConfig, prof.PluginConfig); diff != "" {
254244
t.Errorf("wrong plugin config (-want, +got): %s", diff)
255245
}
@@ -465,7 +455,6 @@ func newConfigFactoryWithFrameworkRegistry(
465455
podInformer: informerFactory.Core().V1().Pods(),
466456
disablePreemption: disablePodPreemption,
467457
percentageOfNodesToScore: schedulerapi.DefaultPercentageOfNodesToScore,
468-
bindTimeoutSeconds: bindTimeoutSeconds,
469458
podInitialBackoffSeconds: podInitialBackoffDurationSeconds,
470459
podMaxBackoffSeconds: podMaxBackoffDurationSeconds,
471460
StopEverything: stopCh,

0 commit comments

Comments
 (0)