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

Default requests to limits in Workload #317

Merged
merged 1 commit into from
Aug 10, 2022

Conversation

alculquicondor
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

Default requests to limits if requests are not set.
This matches the internal defaulting for k8s Pods.

Which issue(s) this PR fixes:

Fixes #316

Special notes for your reviewer:

@k8s-ci-robot k8s-ci-robot added 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 Aug 9, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor

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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Aug 9, 2022
if the requests are not set

Change-Id: I9f59d9e87f48d51afc1c48082943cc3233a2fd1b
func setContainersDefaults(containers []corev1.Container) {
for i := range containers {
c := &containers[i]
if c.Resources.Limits != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not related to this PR, we currently leverage the requests in resource quota, should we also consider the limits.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you talking about kubernetes' ResourceQuotas? If so, I would imagine they run after defaults are applied, but I don't have expertise to know for sure.

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean the resources.Limits in podSpec.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was the intention that we only look at requests, similar to the NodeResources Filter plugin in kube-scheduler.

@kerthcet
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 Aug 10, 2022
@k8s-ci-robot k8s-ci-robot merged commit 17270f6 into kubernetes-sigs:main Aug 10, 2022
kerthcet added a commit to kerthcet/kueue that referenced this pull request Feb 27, 2023
In kubernetes-sigs#317, we will default workload resource requests to limits
if requests not specified. But this will introduce a bug for in job controller reconciling, job will be judged
as not equal to workload, so workload will be deleted and re-create indefinitely

Signed-off-by: Kante Yin <[email protected]>
kerthcet added a commit to kerthcet/kueue that referenced this pull request Mar 2, 2023
In kubernetes-sigs#317, we will default workload resource requests to limits
if requests not specified. But this will introduce a bug for in job controller reconciling, job will be judged
as not equal to workload, so workload will be deleted and re-create indefinitely

Signed-off-by: Kante Yin <[email protected]>
kerthcet added a commit to kerthcet/kueue that referenced this pull request Mar 2, 2023
In kubernetes-sigs#317, we will default workload resource requests to limits
if requests not specified. But this will introduce a bug for in job controller reconciling, job will be judged
as not equal to workload, so workload will be deleted and re-create indefinitely

Signed-off-by: Kante Yin <[email protected]>
kerthcet added a commit to kerthcet/kueue that referenced this pull request Mar 2, 2023
In kubernetes-sigs#317, we will default workload resource requests to limits
if requests not specified. But this will introduce a bug for in job controller reconciling, job will be judged
as not equal to workload, so workload will be deleted and re-create indefinitely

Signed-off-by: Kante Yin <[email protected]>
kerthcet added a commit to kerthcet/kueue that referenced this pull request Mar 9, 2023
In kubernetes-sigs#317, we will default workload resource requests to limits
if requests not specified. But this will introduce a bug for in job controller reconciling, job will be judged
as not equal to workload, so workload will be deleted and re-create indefinitely

Signed-off-by: Kante Yin <[email protected]>
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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default requests to limits in Workload
3 participants