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

Add LimitRange based validation before admission #613

Merged
merged 6 commits into from
Apr 19, 2023

Conversation

trasc
Copy link
Contributor

@trasc trasc commented Mar 7, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

This PR adds two additional checks in the nomination :

  • Verify that all the containers resource requests are lower or equal to it's resource limits
  • Verify that the podSet definition will not violate the namespace defined limit ranges

When any of this checks fail, the Admission condition message will provide the necessary details.

With these new checks , kueue is able to avoid admitting workloads that otherwise will fail to create the necessary pods.

Which issue(s) this PR fixes:

Fixes #612

Special notes for your reviewer:

cc: @alculquicondor @mwielgus

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels Mar 7, 2023
@netlify
Copy link

netlify bot commented Mar 7, 2023

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit 66ee917
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/643fded076f0c200079055f5

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 7, 2023
@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 Mar 7, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @trasc. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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 size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Mar 7, 2023
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 9, 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 Mar 21, 2023
@trasc trasc changed the title Add workload LimiRange based validation Add LimitRange based validation before admission Mar 21, 2023
@trasc trasc marked this pull request as ready for review March 21, 2023 14:32
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 21, 2023
@trasc
Copy link
Contributor Author

trasc commented Mar 21, 2023

/cc @mwielgus

@alculquicondor
Copy link
Contributor

/ok-to-test

@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 Mar 21, 2023
pkg/scheduler/scheduler.go Outdated Show resolved Hide resolved
pkg/util/resource/resource.go Outdated Show resolved Hide resolved
pkg/util/limitrange/limitrange.go Show resolved Hide resolved
pkg/util/limitrange/limitrange.go Outdated Show resolved Hide resolved
test/integration/scheduler/scheduler_test.go Outdated Show resolved Hide resolved
pkg/scheduler/scheduler.go Outdated Show resolved Hide resolved
@trasc trasc force-pushed the verify_limit_ranges branch 2 times, most recently from 103dfc0 to 543e53a Compare March 23, 2023 13:56
@alculquicondor
Copy link
Contributor

Looking good, but we can leave this one for after the release

/hold

@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 Mar 23, 2023
@alculquicondor alculquicondor added this to the v0.4 milestone Apr 11, 2023
@alculquicondor
Copy link
Contributor

/hold cancel

@tenzen-y could you give a pass?

@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 Apr 11, 2023
@tenzen-y
Copy link
Member

/hold cancel

@tenzen-y could you give a pass?

Sure. Within this week, I will review this one.

/cc

Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

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

overall looks good. some nits.

pkg/util/resource/resource.go Outdated Show resolved Hide resolved
pkg/scheduler/scheduler.go Outdated Show resolved Hide resolved
pkg/scheduler/scheduler.go Outdated Show resolved Hide resolved
pkg/scheduler/scheduler.go Outdated Show resolved Hide resolved
pkg/scheduler/scheduler.go Outdated Show resolved Hide resolved
pkg/util/limitrange/limitrange.go Outdated Show resolved Hide resolved
pkg/util/limitrange/limitrange.go Outdated Show resolved Hide resolved
pkg/util/limitrange/limitrange_test.go Outdated Show resolved Hide resolved
pkg/util/limitrange/limitrange_test.go Outdated Show resolved Hide resolved
pkg/util/limitrange/limitrange_test.go Show resolved Hide resolved
@alculquicondor
Copy link
Contributor

/approve

Leaving LGTM to @tenzen-y

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

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

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 14, 2023
@tenzen-y
Copy link
Member

/label tide/merge-method-squash

@k8s-ci-robot k8s-ci-robot added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Apr 19, 2023
@tenzen-y
Copy link
Member

Thanks!
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 19, 2023
@k8s-ci-robot k8s-ci-robot merged commit 9ca57c8 into kubernetes-sigs:main Apr 19, 2023
@trasc trasc deleted the verify_limit_ranges branch April 20, 2023 06:01
@alculquicondor
Copy link
Contributor

Could you add an entry in the changelog for this?

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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Apply LimitRange validation on workloads.
4 participants