-
Notifications
You must be signed in to change notification settings - Fork 40k
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 Bind extension point of the scheduling framework #78513
Conversation
Hi @chenchun. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
@@ -42,6 +42,8 @@ const ( | |||
Unschedulable | |||
// Wait is used when a permit plugin finds a pod scheduling should wait. | |||
Wait | |||
// Whether a bind plugin chooses to skip binding |
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.
Please start comments with Skip ...
/ok-to-test |
/assign @bsalamat |
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.
Thanks, @chenchun! Generally LGTM. Only a couple of minor comments.
// RunBindPlugins runs the set of configured bind plugins. A bind plugin may choose | ||
// whether or not to handle the given Pod. If a bind plugin chooses to skip the | ||
// binding, it should return code=4("skip") status. Otherwise, it should return "Error" | ||
// or "Success". If none of the plugins handled binding, RunBindPlugins returns |
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.
RunBindPlugins
should one day return an error if all bind plugins 'Skip' the pod, but this is fine for now that we want to run the default bind function if none of the bind plugins process the pod. My hope is that the current bind function will one day be a (default) plugin.
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.
Maybe we can do it in a following PR.
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 opened an issue #79215 to track this and I could raise a PR after this get merged.
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.
RunBindPlugins
should one day return an error if all bind plugins 'Skip' the pod, but this is fine for now that we want to run the default bind function if none of the bind plugins process the pod. My hope is that the current bind function will one day be a (default) plugin.
This is a great idea
}, | ||
} | ||
// Set reserve and bind config for testing | ||
pluginConfig := []schedulerconfig.PluginConfig{ |
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.
Not related to this PR, but we should make providing a pluginConfig for plugins optional so that something like this is not necessary if one does not need to pass any args to 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.
Agreed.
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.
Actually plugin config can be nil. I opened #80567 to clean up the verbose code.
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.
/lgtm
/approve
Thanks, @chenchun!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: bsalamat, chenchun 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 |
@@ -599,6 +637,165 @@ func TestUnreservePlugin(t *testing.T) { | |||
} | |||
} | |||
|
|||
// TestBindPlugin tests invocation of bind 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.
It seems this test is flaky:
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.
Met the same problem in https://github.com/kubernetes/kubernetes/pull/78513/files
What type of PR is this?
/kind feature
/priority important-soon
/sig scheduling
What this PR does / why we need it:
Add Bind extension point of the scheduling framework
Which issue(s) this PR fixes:
Fixes #78006
Special notes for your reviewer:
Does this PR introduce a user-facing change?: