Prefer highest value on duplicate container metrics#1779
Conversation
|
This issue is currently awaiting triage. If metrics-server contributors determine this is a relevant issue, they will accept it by applying the The DetailsInstructions 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-sigs/prow repository. |
|
Hi @dippynark. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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-sigs/prow repository. |
7b5896b to
bd13c20
Compare
|
/assign @serathius |
7326bba to
eae4273
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: dippynark The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
This is caused by a kubelet bug fixed in the following PR: kubernetes/kubernetes#137942 |
What this PR does / why we need it:
If kubelet fails to cleanup cgroups from a previous instance of a container (e.g. due to some zombie process), cAdvisor will continue to expose its metrics (see kubernetes/kubernetes#134518 (comment) for more details).
The following shows an example of a kubelet v1.30.10 returning multiple metrics for the same container (same namespace/name but different UID):
Currently Metrics Server will silently override these duplicates giving unpredictable results. This PR improves consistency by always picking the highest value when there are duplicates. In particular, if we are using these metrics to scale memory vertically with VPA, we prefer to overprovision than underpovision.
Note that doing this with CPU does not necessarily help since it is calculated as a rate, however we do this anyway just to make the response consistent (and once
container_cpu_usage_seconds_totalfor a new instance catches up with the old one CPU utilisation for the latest container instance will be calculated properly).This PR coupled with #1778 makes Metrics Server more resilient to the root cause which should be fixed by this PR.