Kubelet enabling to support pod-overhead#79247
Kubelet enabling to support pod-overhead#79247k8s-ci-robot merged 4 commits intokubernetes:masterfrom
Conversation
|
/cc @tallclair @dashpole The changes are pretty basic, but I was having issues getting a basic unit test working for ie: I think this is why the Deep.Equal is failing. Is this the expected behavior? Or, any suggestions? |
6e67a56 to
68cfa0b
Compare
68cfa0b to
6837f7b
Compare
|
Can we use quantity's |
|
@dashpole - yes, but that'll require looping through each resource in the list, verifying each entry exists, and that for each quantity, quantity.Equal(expected). A bit painful; I'd at least like to understand if its expected behavior or not. Perhaps there should be a "ResourceList" Equal function? |
2163ce4 to
751e2d9
Compare
|
Updated the test per @dashpole's recommendation, and improved limits handling |
751e2d9 to
87d1f3f
Compare
|
@egernst: GitHub didn't allow me to request PR reviews from the following users: mcastelino, jcvenegas. Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs. DetailsIn 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. |
87d1f3f to
08f189a
Compare
egernst
left a comment
There was a problem hiding this comment.
Updated based on feedback - PTAL @tallclair @dashpole
Update GetResoureqRequest function to utilize a new helper, GetResourceRequestQuantity. This logic was duplicated in a couple of areas in the K/K codebase, so consolidating for better test coverage. Signed-off-by: Eric Ernst <eric.ernst@intel.com>
Utilize resource helpers' GetResourceRequestQuantity instead of duplicating the logic here. Signed-off-by: Eric Ernst <eric.ernst@intel.com>
No test content changes - just improvements for readability Signed-off-by: Eric Ernst <eric.ernst@intel.com>
tallclair
left a comment
There was a problem hiding this comment.
Mostly nits, sorry to complain about the newlines.
pkg/api/v1/resource/helpers_test.go
Outdated
There was a problem hiding this comment.
thanks, so much more readable this way.
0b515bc to
05b9ff4
Compare
|
Thanks @tallclair - will keep that in mind for next PR. Addressed feedback, including utilizing .Copy() instead of assigning potential cached value. |
|
Thanks! /lgtm Need to fix up ssome of those CI failures. rerun |
05b9ff4 to
b813515
Compare
|
/lgtm |
|
/assign @thockin |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: egernst, tallclair, thockin The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/test pull-kubernetes-e2e-gce |
pkg/api/v1/resource/helpers.go
Outdated
There was a problem hiding this comment.
nit: use DeepCopy (#81627)
| requestQuantity = *rQuantity.Copy() | |
| requestQuantity = rQuantity.DeepCopy() |
|
Hmm, the test failures are somewhat suspicious since it's the density & loader tests failing, which would be affected by PodOverhead. Except that overhead on those should be zero, and I think the feature gate is disabled, so probably a flake. Worth taking a look at though. |
b813515 to
80ee072
Compare
Pod and burstable QoS cgroups should take overhead of running a sandbox into account if the PodOverhead feature is enabled. These helper functions are utilized by Kubelet for sizing the pod and burstable QoS cgroups. Pod overhead is added to resource requests, regardless of the initial request values. A particular resource pod overhead is only added to a resource limit if a non-zero limit already existed. This commit updates eviction handling to also take Pod Overhead into account (if the feature is enabled). Signed-off-by: Eric Ernst <eric.ernst@intel.com>
Thanks. It is at the very least a reminder of e2e tests which should be added for PodOverhead. |
|
/lgtm |
| totalResources += rQuantity.Value() | ||
| } | ||
| if rQuantity, ok := container.Resources.Requests[resourceName]; ok { | ||
| requestQuantity.Add(rQuantity) |
There was a problem hiding this comment.
Should rQuantity.MilliValue() be used if resourceName is v1.ResourceCPU ?
Pod and burstable QoS cgroups should take overhead of running a sandbox
into account if the PodOverhead feature is enabled. Update helper
functions which are utilized by Kubelet for sizing the pod and burstable QoS
cgroups as well as for eviction and preemption handling.
While enabling PodOverhead support, refactored a couple of functions to remove duplicated logic and improve test coverage (ie, have eviction handling use the resources package).
What type of PR is this?
/kind feature
What this PR does / why we need it:
Pod and burstable QoS cgroups should take overhead of running a sandbox
into account if the PodOverhead feature is enabled. Similarly, pod overhead should be considered within the eviction handling in Kubernetes.
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer: