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

Tracking nodes with pods with affinity #84824

Merged
merged 1 commit into from
Nov 6, 2019

Conversation

ahg-g
Copy link
Member

@ahg-g ahg-g commented Nov 5, 2019

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds a list to nodeinfo snapshot that tracks the nodes with at least one pod with affinity terms. This is useful to avoid iterating over unrelated nodes for inter-pod affinity priority and inter-pod anti-affinity predicate

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

This will help avoid the performance degradation from #84669

Before:

BenchmarkSchedulingV/5000Nodes/1000Pods-12          1000           6481403 ns/op
BenchmarkSchedulingPodAntiAffinity/5000Nodes/1000Pods-12                    1000           8203782 ns/op
BenchmarkSchedulingSecrets/5000Nodes/1000Pods-12                            1000           7180056 ns/op
BenchmarkSchedulingInTreePVs/5000Nodes/1000Pods-12                          1000          13674520 ns/op
BenchmarkSchedulingMigratedInTreePVs/5000Nodes/1000Pods-12                  1000          12901412 ns/op
BenchmarkSchedulingCSIPVs/5000Nodes/1000Pods-12                             1000          11295372 ns/op
BenchmarkSchedulingPodAffinity/5000Nodes/1000Pods-12                        1000          12800015 ns/op
BenchmarkSchedulingNodeAffinity/5000Nodes/1000Pods-12                       1000          11432830 ns/op

After:

BenchmarkSchedulingV/5000Nodes/1000Pods-12          1000           5593549 ns/op
BenchmarkSchedulingPodAntiAffinity/5000Nodes/1000Pods-12                    1000           7663664 ns/op
BenchmarkSchedulingSecrets/5000Nodes/1000Pods-12                            1000           6269434 ns/op
BenchmarkSchedulingInTreePVs/5000Nodes/1000Pods-12                          1000          12713162 ns/op
BenchmarkSchedulingMigratedInTreePVs/5000Nodes/1000Pods-12                  1000          11840169 ns/op
BenchmarkSchedulingCSIPVs/5000Nodes/1000Pods-12                             1000          10337815 ns/op
BenchmarkSchedulingPodAffinity/5000Nodes/1000Pods-12                        1000          12088693 ns/op
BenchmarkSchedulingNodeAffinity/5000Nodes/1000Pods-12                       1000          10787583 ns/op

Does this PR introduce a user-facing change?:

NONE

/assign @Huang-Wei

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ahg-g

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 approved Indicates a PR has been approved by an approver from all required OWNERS files. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 5, 2019
@ahg-g
Copy link
Member Author

ahg-g commented Nov 5, 2019

/retest

@Huang-Wei
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 5, 2019
@ahg-g ahg-g force-pushed the ahg-nodes-with-affinity-pods branch from 5bf1608 to f2913bd Compare November 6, 2019 00:36
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 6, 2019
@ahg-g
Copy link
Member Author

ahg-g commented Nov 6, 2019

/priority important-soon

@k8s-ci-robot k8s-ci-robot added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Nov 6, 2019
Comment on lines 265 to 270
// WithAffinityPodsList lists nodes.
func (nodes NodeInfoLister) HavePodsWithAffinityList() ([]*schedulernodeinfo.NodeInfo, error) {
return nodes, nil
}

Copy link
Member

Choose a reason for hiding this comment

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

Comments needs to be updated.

@ahg-g ahg-g force-pushed the ahg-nodes-with-affinity-pods branch from f2913bd to 950e1a4 Compare November 6, 2019 00:57
@Huang-Wei
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 6, 2019
@ahg-g ahg-g force-pushed the ahg-nodes-with-affinity-pods branch from 950e1a4 to f83a20c Compare November 6, 2019 00:59
@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 6, 2019
@ahg-g ahg-g force-pushed the ahg-nodes-with-affinity-pods branch from f83a20c to c33f217 Compare November 6, 2019 01:02
@ahg-g
Copy link
Member Author

ahg-g commented Nov 6, 2019

/retest

1 similar comment
@ahg-g
Copy link
Member Author

ahg-g commented Nov 6, 2019

/retest

@draveness
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 6, 2019
@k8s-ci-robot k8s-ci-robot merged commit f35a92c into kubernetes:master Nov 6, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.17 milestone Nov 6, 2019
@ahg-g ahg-g deleted the ahg-nodes-with-affinity-pods branch January 10, 2020 15:38
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. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note-none Denotes a PR that doesn't merit a release note. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants