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

fix bug of resource computing #1225

Merged
merged 1 commit into from
Jan 11, 2022
Merged

Conversation

Garrybest
Copy link
Member

@Garrybest Garrybest commented Jan 8, 2022

Signed-off-by: Garrybest garrybest@foxmail.com

What type of PR is this?
/kind bug

What this PR does / why we need it:

  1. If pod limits are specified, but requests are not, default requests to limits.
  2. If Overhead is being utilized, add to the total requests for the pod.

Which issue(s) this PR fixes:
Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

karmada-scheduler: Fixed pod requested resource inaccuracy issue in case of pod limits specified but leaves request empty.

Signed-off-by: Garrybest <garrybest@foxmail.com>
@karmada-bot karmada-bot added the kind/bug Categorizes issue or PR as related to a bug. label Jan 8, 2022
@karmada-bot karmada-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 8, 2022
@RainbowMango
Copy link
Member

cc @huone1
Could you please look at this PR?

Copy link
Member

@RainbowMango RainbowMango left a comment

Choose a reason for hiding this comment

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

I wonder how and when the SetDefaults_Pod executed? Does the karmada-apiserver also set the defaults for Pod?

@Garrybest
Copy link
Member Author

I wonder how and when the SetDefaults_Pod executed? Does the karmada-apiserver also set the defaults for Pod?

The api-server mutating webhook will set the default values. See here

@huone1
Copy link
Contributor

huone1 commented Jan 10, 2022

the overhead resource data should be obtained through by RuntimeClass; the podtemplate shouldn't have the overhead info and the POD instance just contain the the overhead info

@RainbowMango
Copy link
Member

/lgtm
/approve

@karmada-bot karmada-bot added the lgtm Indicates that a PR is ready to be merged. label Jan 11, 2022
@karmada-bot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: RainbowMango

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

@karmada-bot karmada-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 11, 2022
@karmada-bot karmada-bot merged commit 596f214 into karmada-io:master Jan 11, 2022
@Garrybest Garrybest deleted the pr_resource branch January 11, 2022 02:10
@RainbowMango
Copy link
Member

Discussed this with @huone1 locally, I get his concern now.

Since the karmada-apiserver only set overhead fields for Pod, but not for other workloads like Deployment, Job, etc.
So, the overhead will be always empty for these workloads, which means we can't get precise resource requirements.

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. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. 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.

None yet

4 participants