mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-22 10:27:56 +00:00
Merge pull request #94636 from hprateek43/cpu_threads_parameter
Added config parameter for CPU threads
This commit is contained in:
@@ -42,6 +42,7 @@ import (
|
||||
frameworkplugins "k8s.io/kubernetes/pkg/scheduler/framework/plugins"
|
||||
frameworkruntime "k8s.io/kubernetes/pkg/scheduler/framework/runtime"
|
||||
internalcache "k8s.io/kubernetes/pkg/scheduler/internal/cache"
|
||||
"k8s.io/kubernetes/pkg/scheduler/internal/parallelize"
|
||||
internalqueue "k8s.io/kubernetes/pkg/scheduler/internal/queue"
|
||||
"k8s.io/kubernetes/pkg/scheduler/metrics"
|
||||
"k8s.io/kubernetes/pkg/scheduler/profile"
|
||||
@@ -109,6 +110,14 @@ func WithProfiles(p ...schedulerapi.KubeSchedulerProfile) Option {
|
||||
}
|
||||
}
|
||||
|
||||
// WithParallelism sets the parallelism for all scheduler algorithms. Default is 16.
|
||||
// TODO(#95952): Remove global setter in favor of a struct that holds the configuration.
|
||||
func WithParallelism(threads int32) Option {
|
||||
return func(o *schedulerOptions) {
|
||||
parallelize.SetParallelism(int(threads))
|
||||
}
|
||||
}
|
||||
|
||||
// WithAlgorithmSource sets schedulerAlgorithmSource for Scheduler, the default is a source with DefaultProvider.
|
||||
func WithAlgorithmSource(source schedulerapi.SchedulerAlgorithmSource) Option {
|
||||
return func(o *schedulerOptions) {
|
||||
|
Reference in New Issue
Block a user