-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Graduate kube-scheduler NodeInclusionPolicy to beta #113500
Graduate kube-scheduler NodeInclusionPolicy to beta #113500
Conversation
/remove-sig apps api-machinery |
f609164
to
b036034
Compare
/test pull-kubernetes-unit |
Signed-off-by: kerthcet <[email protected]>
b036034
to
8d78b37
Compare
/retest |
This is the benchmark results for nodeInclusionPolicy:
|
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.
API plumbing lgtm, will defer benchmark review and test change to scheduling reviewer
@@ -119,7 +119,7 @@ func (p *IntegrationTestNodePreparer) PrepareNodes(nextNodeIndex int) error { | |||
func (p *IntegrationTestNodePreparer) CleanupNodes() error { | |||
// TODO(#93794): make CleanupNodes only clean up the nodes created by this | |||
// IntegrationTestNodePreparer to make this more intuitive. | |||
nodes, err := GetReadySchedulableNodes(p.client) |
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.
curious why this change was needed?
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.
When creating nodes with taints, all these nodes are unschedulable to normal pods, so we'll always return error after calling Filter()
. That means no node satisfied.
checkWaitListSchedulableNodes
will return all nodes with spec.unschedulable
is false, the only difference here is we'll patch more nodes than before, who will not be scheduled pods. So I think it's ok.
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.
This actually impacts all existing tests' behavior to skip nodes' health check. I'm a bit concerned on this. Can you add a param in workloadTemplate
to make the behavior of "ignoring node health check or not" an option?
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.
Should we make the parameter ignore taints, instead of ignoring isNodeSchedulable?
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.
although... why did we even care about getting Ready nodes in the first place? I don't think we have any test cases with non-ready nodes.
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 param is one approach, but try to figure out the reason why we want to filter out taint nodes here. They're actually schedulable if pod tolerates the taints.
kubernetes/test/integration/framework/util.go
Lines 75 to 77 in ee0b179
Filter(nodes, func(node v1.Node) bool { | |
return IsNodeSchedulable(&node) && isNodeUntainted(&node) | |
}) |
I think the change won't impact present tests for we have no taint-related or node-not-ready cases. But in theory, filtering out non-ready nodes when updating patches makes sense to me for the sake of performance especially we have thousands of nodes.
Another question here is when cleaning up, we only remove the readySchedulableNodes
nodes, but we should remove all nodes created by itself. I used to submit a PR to fix this here #112237.
So in summary:
- When calling
PrepareNodes
, I'll get ready and schedulable nodes including nodes with taints - When calling
CleanupNodes
, I'll remove all nodes created by itself as Remove only prepared nodes in performance tests #112237.
WDYT?
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 think we can prepare and cleanup all nodes, given that we always create them as ready (there are no kubelets running in our tests).
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 think we can prepare and cleanup all nodes, given that we always create them as ready (there are no kubelets running in our tests).
I'm ok with this. Also looking forward to @Huang-Wei 's advices.
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.
Created a separate PR here #113615 to make this a pure one, only focus on the API part.
6bd7dcb
to
64adc8b
Compare
The test |
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.
/approve
/hold for nits
@@ -119,7 +119,7 @@ func (p *IntegrationTestNodePreparer) PrepareNodes(nextNodeIndex int) error { | |||
func (p *IntegrationTestNodePreparer) CleanupNodes() error { | |||
// TODO(#93794): make CleanupNodes only clean up the nodes created by this | |||
// IntegrationTestNodePreparer to make this more intuitive. | |||
nodes, err := GetReadySchedulableNodes(p.client) |
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.
Should we make the parameter ignore taints, instead of ignoring isNodeSchedulable?
@@ -119,7 +119,7 @@ func (p *IntegrationTestNodePreparer) PrepareNodes(nextNodeIndex int) error { | |||
func (p *IntegrationTestNodePreparer) CleanupNodes() error { | |||
// TODO(#93794): make CleanupNodes only clean up the nodes created by this | |||
// IntegrationTestNodePreparer to make this more intuitive. | |||
nodes, err := GetReadySchedulableNodes(p.client) |
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.
although... why did we even care about getting Ready nodes in the first place? I don't think we have any test cases with non-ready nodes.
64adc8b
to
8d78b37
Compare
Hold until #113615 got merged first. |
/lgtm |
/hold cancel |
/assign @liggitt |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, kerthcet, liggitt 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 |
/triage accepted |
Signed-off-by: kerthcet [email protected]
What type of PR is this?
/kind feature
/sig scheduling
What this PR does / why we need it:
Graduate NodeInclusionPolicy to beta, only api part.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: