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

feat(NodeVolumeLimits): return Skip in PreFilter #115398

Merged

Conversation

tangwz
Copy link
Contributor

@tangwz tangwz commented Jan 30, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

return Skip in nodevolumelimits PreFilter when the pods that only use secrets and configmaps.

Which issue(s) this PR fixes:

Fixes #114143 #114399

Special notes for your reviewer:

Does this PR introduce a user-facing change?

NodeVolumeLimits implement the PreFilter extension point for skipping the Filter phase if the Pod doesn't use volumes with limits.

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/L Denotes a PR that changes 100-499 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. labels Jan 30, 2023
@k8s-ci-robot k8s-ci-robot added sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Jan 30, 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-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 30, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @tangwz. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label Jan 30, 2023
@kerthcet
Copy link
Member

kerthcet commented Feb 3, 2023

/ok-to-test
sorry for let this sitting a long time.

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Feb 3, 2023
@kerthcet
Copy link
Member

kerthcet commented Feb 3, 2023

/assign

@kerthcet
Copy link
Member

kerthcet commented Feb 3, 2023

ping @tangwz can you plz address the test failures at first?

@k8s-ci-robot k8s-ci-robot added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Feb 6, 2023
@tangwz
Copy link
Contributor Author

tangwz commented Feb 6, 2023

/ok-to-test

@k8s-triage-robot
Copy link

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.

@tangwz
Copy link
Contributor Author

tangwz commented Feb 6, 2023

@kerthcet PTAL

@kerthcet
Copy link
Member

/assign

Copy link
Member

@mborsz mborsz left a comment

Choose a reason for hiding this comment

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

Thank you!

Just few nits!

pkg/scheduler/framework/plugins/nodevolumelimits/csi.go Outdated Show resolved Hide resolved
pkg/scheduler/framework/plugins/nodevolumelimits/csi.go Outdated Show resolved Hide resolved
@alculquicondor
Copy link
Member

/cc

@alculquicondor
Copy link
Member

This needs a release note, because you are adding a PreFilter endpoint.

@tangwz tangwz force-pushed the add_NodeVolumeLimits_PreFilter branch from d57fd06 to 07905f0 Compare March 28, 2023 15:24
@tangwz
Copy link
Contributor Author

tangwz commented Apr 5, 2023

/cc

Nitpick - please squash the commits into a single one: https://github.com/kubernetes/community/blob/master/contributors/guide/contributing.md#best-practices

If this PR ready to by merged, I'll squash it.

@alculquicondor
Copy link
Member

It's ok to squash as long as there were no intermediate reviews. But also it's fine to leave it for later.

Copy link
Member

@kerthcet kerthcet left a comment

Choose a reason for hiding this comment

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

LGTM with the logics, but left some comments with tests.

Secret: &v1.SecretVolumeSource{},
},
}).Obj()
notOnlyConfigmapAndSecretPod = st.MakePod().PVC("pvcWithDeletedPV").Volume(v1.Volume{
Copy link
Member

Choose a reason for hiding this comment

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

pvcPodWithConfigmapAndSecret

Copy link
Member

Choose a reason for hiding this comment

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

Also add another two cases covering the PerFilter.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Already has Ephemeral.

@tangwz tangwz force-pushed the add_NodeVolumeLimits_PreFilter branch from ed9efa7 to 5ede346 Compare April 9, 2023 07:46
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Apr 9, 2023
@tangwz
Copy link
Contributor Author

tangwz commented Apr 9, 2023

/retest

Copy link
Member

@kerthcet kerthcet left a comment

Choose a reason for hiding this comment

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

Can we move oneVolPod to TestEBSLimits as well? Totally LGTM, you can squash now. And sorry for the delayed response because of the kubecon.
/assign @alculquicondor

Copy link
Member

@alculquicondor alculquicondor left a comment

Choose a reason for hiding this comment

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

/approve
Leaving LGTM to @kerthcet


if gotPreFilterStatus.Code() != framework.Skip {
gotStatus := p.Filter(context.Background(), nil, test.newPod, node)
if !reflect.DeepEqual(gotStatus, test.wantStatus) {
Copy link
Member

Choose a reason for hiding this comment

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

also refactor these to cmp.Diff in a follow up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's ok, I will do.

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 Apr 24, 2023
@tangwz tangwz force-pushed the add_NodeVolumeLimits_PreFilter branch from e464ae7 to 8f99e33 Compare April 25, 2023 13:59
@tangwz
Copy link
Contributor Author

tangwz commented Apr 25, 2023

/retest

@tangwz tangwz force-pushed the add_NodeVolumeLimits_PreFilter branch from 8f99e33 to 8ed8618 Compare April 26, 2023 12:17
@tangwz
Copy link
Contributor Author

tangwz commented Apr 26, 2023

@kerthcet PTAL

@kerthcet
Copy link
Member

/lgtm
Thanks @tangwz

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

LGTM label has been added.

Git tree hash: 7d5aa2eea43979c4b86e9ac0e2bf1ae14877f73e

@tosi3k
Copy link
Member

tosi3k commented Apr 27, 2023

/retest

@k8s-ci-robot k8s-ci-robot merged commit 87f3acf into kubernetes:master Apr 27, 2023
12 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.28 milestone Apr 27, 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/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API 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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Optimize NodeVolumeLimits plugin
7 participants