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

Restore default hotplug attachment pod request to original values #10720

Merged
merged 2 commits into from Nov 15, 2023

Conversation

awels
Copy link
Member

@awels awels commented Nov 13, 2023

What this PR does / why we need it:
As a quick fix we modified the requests and limit ratio to be 1. However this is not ideal since it reserves a lot of cpu and memory for that container that doesn't really do anything at all. Its purpose is to attach a volume to the node.

We added the ability to set the requests and limits for all the supporting containers in (#9422). At this point anyone can set the ratio to what they want. So lets restore the defaults to the original values, so that people that don't care don't end up using a lot of memory for no reason.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

Checklist

This checklist is not enforcing, but it's a reminder of items that could be relevant to every PR.
Approvers are expected to review this list.

Release note:

Restored hotplug attachment pod request/limit to original value

As a quick fix we modified the requests and limit ratio to
be 1. However this is not ideal since it reserves a lot of
cpu and memory for that container that doesn't really do
anything at all. Its purpose is to attach a volume to the node.

We added the ability to set the requests and limits for all the
supporting containers in (kubevirt#9422). At this point anyone can set
the ratio to what they want. So lets restore the defaults to the
original values, so that people that don't care don't end up using
a lot of memory for no reason.

Signed-off-by: Alexander Wels <awels@redhat.com>
@kubevirt-bot kubevirt-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. size/S labels Nov 13, 2023
@awels
Copy link
Member Author

awels commented Nov 13, 2023

/test pull-kubevirt-unit-test

Copy link
Member

@xpivarc xpivarc left a comment

Choose a reason for hiding this comment

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

/approve

@kubevirt-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xpivarc

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

@kubevirt-bot kubevirt-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 13, 2023
@awels
Copy link
Member Author

awels commented Nov 13, 2023

/test pull-kubevirt-e2e-k8s-1.26-sig-storage

@@ -4070,7 +4070,7 @@ var _ = Describe("Template", func() {
Expect(memLimit).To(Equal(expMemLimitQ.Value()))
expCpuReqQ := resource.MustParse("100m")
Expect(cpuReq).To(Equal(expCpuReqQ.Value()))
expMemReqQ := resource.MustParse("80M")
expMemReqQ := resource.MustParse("2M")
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd expect expCpuReqQ := resource.MustParse("100m") to be expCpuReqQ := resource.MustParse("10m")

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, reading my own comment I realize this is too criptic.
What I mean is that here the expected memory request was reduced back to 2M.
I would expect the same to happen for the cpu request too, IOW to be rolled back to 10m, but it is not.
Can you explain? Thanks

Copy link
Member Author

Choose a reason for hiding this comment

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

No you are right, have to check why just the one, and not the other.

Copy link
Member Author

Choose a reason for hiding this comment

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

So turns out the unscaled value of 10m and 100m is both '1' and thus matches, instead I need to use MilliValue, and that fixes the issue.

so that the scaled values don't match. 10m and 100m
are 1 when calling Value, but 10 and 100 when calling
MilliValue.

Signed-off-by: Alexander Wels <awels@redhat.com>
@awels
Copy link
Member Author

awels commented Nov 14, 2023

/test pull-kubevirt-e2e-k8s-1.27-sig-network

@fossedihelm
Copy link
Contributor

Thank you!
/lgtm
/retest-required

@kubevirt-bot kubevirt-bot added the lgtm Indicates that a PR is ready to be merged. label Nov 15, 2023
@kubevirt-bot kubevirt-bot merged commit b5bf9e0 into kubevirt:main Nov 15, 2023
37 checks passed
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants