@@ -76,9 +76,6 @@ type Scheduler struct {
76
76
// Close this to shut down the scheduler.
77
77
StopEverything <- chan struct {}
78
78
79
- // Disable pod preemption or not.
80
- DisablePreemption bool
81
-
82
79
// SchedulingQueue holds pods to be scheduled
83
80
SchedulingQueue internalqueue.SchedulingQueue
84
81
@@ -97,7 +94,6 @@ func (sched *Scheduler) Cache() internalcache.Cache {
97
94
98
95
type schedulerOptions struct {
99
96
schedulerAlgorithmSource schedulerapi.SchedulerAlgorithmSource
100
- disablePreemption bool
101
97
percentageOfNodesToScore int32
102
98
podInitialBackoffSeconds int64
103
99
podMaxBackoffSeconds int64
@@ -126,13 +122,6 @@ func WithAlgorithmSource(source schedulerapi.SchedulerAlgorithmSource) Option {
126
122
}
127
123
}
128
124
129
- // WithPreemptionDisabled sets disablePreemption for Scheduler, the default value is false
130
- func WithPreemptionDisabled (disablePreemption bool ) Option {
131
- return func (o * schedulerOptions ) {
132
- o .disablePreemption = disablePreemption
133
- }
134
- }
135
-
136
125
// WithPercentageOfNodesToScore sets percentageOfNodesToScore for Scheduler, the default value is 50
137
126
func WithPercentageOfNodesToScore (percentageOfNodesToScore int32 ) Option {
138
127
return func (o * schedulerOptions ) {
@@ -187,7 +176,6 @@ var defaultSchedulerOptions = schedulerOptions{
187
176
schedulerAlgorithmSource : schedulerapi.SchedulerAlgorithmSource {
188
177
Provider : defaultAlgorithmSourceProviderName (),
189
178
},
190
- disablePreemption : false ,
191
179
percentageOfNodesToScore : schedulerapi .DefaultPercentageOfNodesToScore ,
192
180
podInitialBackoffSeconds : int64 (internalqueue .DefaultPodInitialBackoffDuration .Seconds ()),
193
181
podMaxBackoffSeconds : int64 (internalqueue .DefaultPodMaxBackoffDuration .Seconds ()),
@@ -227,7 +215,6 @@ func New(client clientset.Interface,
227
215
podInformer : podInformer ,
228
216
schedulerCache : schedulerCache ,
229
217
StopEverything : stopEverything ,
230
- disablePreemption : options .disablePreemption ,
231
218
percentageOfNodesToScore : options .percentageOfNodesToScore ,
232
219
podInitialBackoffSeconds : options .podInitialBackoffSeconds ,
233
220
podMaxBackoffSeconds : options .podMaxBackoffSeconds ,
@@ -276,7 +263,6 @@ func New(client clientset.Interface,
276
263
return nil , fmt .Errorf ("unsupported algorithm source: %v" , source )
277
264
}
278
265
// Additional tweaks to the config produced by the configurator.
279
- sched .DisablePreemption = options .disablePreemption
280
266
sched .StopEverything = stopEverything
281
267
sched .client = client
282
268
sched .scheduledPodsHasSynced = podInformer .Informer ().HasSynced
@@ -481,9 +467,8 @@ func (sched *Scheduler) scheduleOne(ctx context.Context) {
481
467
// into the resources that were preempted, but this is harmless.
482
468
nominatedNode := ""
483
469
if fitError , ok := err .(* core.FitError ); ok {
484
- if sched .DisablePreemption || ! prof .HasPostFilterPlugins () {
485
- klog .V (3 ).Infof ("Pod priority feature is not enabled or preemption is disabled by scheduler configuration." +
486
- " No preemption is performed." )
470
+ if ! prof .HasPostFilterPlugins () {
471
+ klog .V (3 ).Infof ("No PostFilter plugins are registered, so no preemption will be performed." )
487
472
} else {
488
473
// Run PostFilter plugins to try to make the pod schedulable in a future scheduling cycle.
489
474
result , status := prof .RunPostFilterPlugins (ctx , state , pod , fitError .FilteredNodesStatuses )
0 commit comments