-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Set mem/cpu request and limits on hotplug attachment pod container to 1 to 1 ratio #9312
Set mem/cpu request and limits on hotplug attachment pod container to 1 to 1 ratio #9312
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concern with this is mostly that it is's incomplete. It does not fully address #9302
What would a proper fix look like? Can the LimitRanges in effect be discovered? Can we detect this error and recreate the pod? Do we need to extend the KubeVirt API to allow our request/limit ration be configured?
And if we want to do a temp fix, should the 1:1 ratio be applied to all containers?
What do you think @vladikr @davidvossel @xpivarc?
} | ||
} | ||
|
||
func hotplugContainerMinimalLimits() k8sv1.ResourceList { | ||
func hotplugContainerMinimalResources() k8sv1.ResourceList { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer maintaining the existing pattern of *MinimalRequests
and *MinimalLimits
functions. In this case the request function can call the limit function. I just feel that is a pattern we will want to go back to eventually with a proper fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name seemed wrong for what it was doing, that is why I changed it. I have no issues keeping the original naming it just didn't seem to fit with this particular change, that is why I changed the name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed the name as requested
/retest-required |
@@ -1158,6 +1162,205 @@ var _ = SIGDescribe("Hotplug", func() { | |||
}) | |||
}) | |||
|
|||
Context("with limit range in namespace", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a unit test would be sufficient. WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a functional test is better (yes it is slower) but we can demonstrate this actually works for various combinations of ratios in a real cluster. A unit test would just show us that indeed the ratio is 1 to 1. But we are interested in does the functionality (hotplugging volumes) still work when various combinations of ratios are defined in the namespace.
There will be a follow up PR of this that adds an API to allow one to specify the exact request/limit for both cpu and memory for all the different support containers. So this PR does NOT completely fix #9302 just the hotplug attachment pod container. |
I am not sure what you mean by this.
I am not fun of tighter integration in Kubevirt. |
So #9302 is about more than just the hotplug attachment pod container, there are other containers in KubeVirt with a similar ratio that will break if you apply the LimitRange with a requestLimitRatio. This particular PR just addresses hotplug, not the other containers. I will be making a much more extensive follow up PR that addresses everything.
|
Assuming other containers will be addressed in subsequent pr /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mhenriks 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 |
Oh I missed that it is a general issue. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/hold
tests/storage/hotplug.go
Outdated
_, err = virtClient.VirtualMachineInstance(vm.Namespace).Get(context.Background(), vm.Name, &metav1.GetOptions{}) | ||
Expect(err).ToNot(HaveOccurred()) | ||
}, | ||
Entry("[Serial]1 to 1 cpu and mem ratio", float64(1), float64(1)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You need a serial label as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I follow. all the entries have a [serial]
label
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We now use gingko labels. Please stand by I am searching for a reference.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://github.com/kubevirt/kubevirt/blob/main/tests/canary_upgrade_test.go#L49 the argument to Desribe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you need
Entry("[Serial]1 to 1 cpu and mem ratio", Serial, float64(1), float64(1)),
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
… 1 to 1 ratio Setting the ratio for mem/cpu to 1 allows the pod to be created under any combination of mem/cpu request/limit ratio. Added functional test to demonstrate various ratios work without issue. Signed-off-by: Alexander Wels <awels@redhat.com>
Signed-off-by: Alexander Wels <awels@redhat.com>
Signed-off-by: Alexander Wels <awels@redhat.com>
e043bbf
to
5002793
Compare
/hold cancel |
@awels: The following test failed, say
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. I understand the commands that are listed here. |
/test pull-kubevirt-e2e-kind-1.23-vgpu |
/cherrypick release-0.59 |
@awels: new pull request created: #9352 In response to this:
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. |
/cherrypick release-0.58 |
@awels: #9312 failed to apply on top of branch "release-0.58":
In response to this:
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. |
…_to_1 Set mem/cpu request and limits on hotplug attachment pod container to 1 to 1 ratio
…_to_1 Set mem/cpu request and limits on hotplug attachment pod container to 1 to 1 ratio
…_to_1 Set mem/cpu request and limits on hotplug attachment pod container to 1 to 1 ratio Signed-off-by: Alexander Wels <awels@redhat.com>
…_to_1 Set mem/cpu request and limits on hotplug attachment pod container to 1 to 1 ratio Signed-off-by: Alexander Wels <awels@redhat.com>
…_to_1 Set mem/cpu request and limits on hotplug attachment pod container to 1 to 1 ratio Signed-off-by: Alexander Wels <awels@redhat.com>
…_to_1 Set mem/cpu request and limits on hotplug attachment pod container to 1 to 1 ratio Signed-off-by: Alexander Wels <awels@redhat.com>
What this PR does / why we need it:
Setting the ratio for mem/cpu to 1 allows the pod to be created under any combination of mem/cpu request/limit ratio. Added functional test to demonstrate various ratios work without issue.
This is a quick fix for just hotplug attachment pod containers for issue #9302 We should investigate a better option that doesn't waste some resources for resource constrained environments.
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:
Release note: