Skip to content
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

noderesourcefit: scheduler queueing hints #119177

Merged
merged 1 commit into from
Dec 15, 2023

Conversation

carlory
Copy link
Member

@carlory carlory commented Jul 8, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:

Part of #118893

Special notes for your reviewer:

Does this PR introduce a user-facing change?

kube-scheduler implements scheduling hints for the NodeResourceFit plugin.
The scheduling hints allow the scheduler to only retry scheduling a Pod
that was previously rejected by the NodeResourceFit plugin if a new Node or 
a Node update matches the Pod's resource requirements or if an old pod update 
or delete matches the  Pod's resource requirements.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jul 8, 2023
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Jul 8, 2023
@k8s-ci-robot k8s-ci-robot added sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 8, 2023
@carlory carlory force-pushed the fix-118893-3 branch 2 times, most recently from 53ff8bf to 81392a2 Compare July 8, 2023 14:42
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jul 8, 2023
@carlory
Copy link
Member Author

carlory commented Jul 8, 2023

/assign @sanposhiho

@carlory
Copy link
Member Author

carlory commented Jul 8, 2023

/test pull-kubernetes-unit

@carlory
Copy link
Member Author

carlory commented Jul 8, 2023

/test pull-kubernetes-node-e2e-containerd

@carlory carlory force-pushed the fix-118893-3 branch 3 times, most recently from b159658 to 23c8576 Compare July 10, 2023 06:49
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 20, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 21, 2023
@carlory
Copy link
Member Author

carlory commented Sep 21, 2023

/test pull-kubernetes-integration

@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Oct 19, 2023
@carlory
Copy link
Member Author

carlory commented Dec 8, 2023

/test pull-kubernetes-node-e2e-containerd

Copy link
Member

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 8, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 4fd410054837940f4f8d272fc4e2abd3f994f21a

@kerthcet
Copy link
Member

So, speaking of this removal, it's not because it'd be a performance enhancement, but it's just because it's problematic.

Sorry for the delayed reply, fair, we should not rely on the wrong assumption.

@alculquicondor
Copy link
Member

/release-note-edit

kube-scheduler implements scheduling hints for the NodeResourceFit plugin.
The scheduling hints allow the scheduler to only retry scheduling a Pod
that was previously rejected by the NodeResourceFit plugin if a new Node or 
a Node update matches the Pod's resource requirements or if an old pod update 
or delete matches the  Pod's resource requirements.

return framework.Queue, err
}

var isFitFunc = func(pod *v1.Pod, node *v1.Node) bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why are you putting this logic inside a function that is used once?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the func was also used to check the origin node in previous comments. we have to drop the logic because of the preCheck on node. please see #119177 (comment) for more context.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unfold the function down below or have it as a separate function, instead of an anonymous function.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated.

pkg/scheduler/framework/plugins/noderesources/fit.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 12, 2023
Co-authored-by: Kensei Nakada <handbomusic@gmail.com>
@alculquicondor
Copy link
Member

/hold

@sanposhiho do any of the problems found for the other scheduler plugins affect this as well?

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 13, 2023
@sanposhiho
Copy link
Member

sanposhiho commented Dec 14, 2023

@alculquicondor

noderesourcefit is impacted by the bug, but we properly handle the scenario: #119177 (comment)
So, basically, I don't see any problem in this implementation. (I should've noticed about other plugins when I commented ^ by the way 😓)

Although it's better to have an integration test to make sure this QHint working appropriately, as part of #122305, IMO it can be followed up.

@alculquicondor
Copy link
Member

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Dec 14, 2023
Copy link
Member

@sanposhiho sanposhiho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

Leave approval for @alculquicondor

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Dec 15, 2023
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: a970ffee4b848cd02d6170b5f2f1068dca3321bf

@alculquicondor
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor, carlory

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 15, 2023
@k8s-ci-robot k8s-ci-robot merged commit 195bb67 into kubernetes:master Dec 15, 2023
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.30 milestone Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

5 participants