-
Notifications
You must be signed in to change notification settings - Fork 39k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support for multiple scheduling profiles #88285
Add support for multiple scheduling profiles #88285
Conversation
59ca8c3
to
9329416
Compare
5f08ebd
to
f7464c4
Compare
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
@@ -591,7 +598,7 @@ func TestSchedulerFailedSchedulingReasons(t *testing.T) { | |||
|
|||
// queuedPodStore: pods queued before processing. | |||
// scache: scheduler cache that might contain assumed pods. | |||
func setupTestScheduler(queuedPodStore *clientcache.FIFO, scache internalcache.Cache, informerFactory informers.SharedInformerFactory, recorder events.EventRecorder, fakeVolumeBinder *volumebinder.VolumeBinder, fns ...st.RegisterPluginFunc) (*Scheduler, chan *v1.Binding, chan error) { | |||
func setupTestScheduler(queuedPodStore *clientcache.FIFO, scache internalcache.Cache, informerFactory informers.SharedInformerFactory, broadcaster events.EventBroadcaster, fakeVolumeBinder *volumebinder.VolumeBinder, fns ...st.RegisterPluginFunc) (*Scheduler, chan *v1.Binding, chan error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of passing it as an argument, I would create the EventBroadcaster
inside the function and return it (since a couple of tests require it).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that there are the same amount of tests that use it than tests that don't.
I prefer to keep it as is for now given that the PR is quite big already.
f7464c4
to
0b55fe5
Compare
/retest |
/assign @Huang-Wei for a second pass It looks like the api-review is almost done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments.
prof := &c.profiles[i] | ||
plugins := &schedulerapi.Plugins{} | ||
plugins.Append(defaultPlugins) | ||
plugins.Apply(prof.Plugins) | ||
prof.Plugins = plugins |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: these 5 lines can be extracted into a function to avoid duplication (with L304~L308)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't mind too much. They are slightly different and createFromConfig
should go away soon when we remove policy support.
8b58bdb
to
1bd94be
Compare
/priority important-soon /hold for #88087 |
1bd94be
to
de4522c
Compare
/hold cancel |
/assign @msau42 |
@alculquicondor: GitHub didn't allow me to assign the following users: for, test. Note that only kubernetes members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me.
@@ -215,7 +197,9 @@ func WithPodMaxBackoffSeconds(podMaxBackoffSeconds int64) Option { | |||
} | |||
|
|||
var defaultSchedulerOptions = schedulerOptions{ | |||
schedulerName: v1.DefaultSchedulerName, | |||
profiles: []schedulerapi.KubeSchedulerProfile{ | |||
{SchedulerName: v1.DefaultSchedulerName}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment clarifying that the default provider plugins is used by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Aldo Culquicondor <acondor@google.com>
de4522c
to
c048858
Compare
/lgtm |
/retest |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, msau42 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
1 similar comment
/retest |
What type of PR is this?
/kind feature
What this PR does / why we need it:
kube-scheduler can run with more than one profile. Given a pod, the profile is selected by using
.spec.SchedulerName
.Profiles should have different scheduler names. They should have the same queue sort plugin configuration.
Which issue(s) this PR fixes:
Part of #85737, kubernetes/enhancements#1451
Special notes for your reviewer:
This PR builds on top of #88087, so you can review from the commit titled:
Support multiple scheduling profiles in a single scheduler
For convenience, I split this PR in 2 commits, which will be squashed after the review.
A follow up PR will add unit and integration tests to exercise the multiple profiles.
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: