-
Notifications
You must be signed in to change notification settings - Fork 38.9k
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
Remove terminated pod from summary api. #77426
Remove terminated pod from summary api. #77426
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Random-Liu 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 |
Signed-off-by: Lantao Liu <lantaol@google.com>
0f9e7c7
to
11cd424
Compare
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.
lgtm
/retest
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.
Need a release note.
/lgtm |
Done. |
/lgtm |
This should hopefully address a number of failure clusters that have cropped up in the past week:
|
} | ||
} | ||
if !found { | ||
result = append(result, refs[len(refs)-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.
I wonder why this is needed ?
I assume the func would only keep READY sandboxes.
When I comment out this line, cri_stats_provider_test still passes.
…7426-upstream-release-1.14 Automated cherry pick of #77426: Remove terminated pod from summary api.
…7426-upstream-release-1.13 Automated cherry pick of #77426: Remove terminated pod from summary api.
I found this when debugging a containerd test failure introduced after #77101 (comment).
In some cases, we may have pod stats with the same name and namespace today:
This only happens to the CRI integration, because we return stats for terminated containers from CRI. To keep the behavior of summary api consistent with before, we should filter out those terminated pods.
Or else, this may break metrics which only use labels
{container name, pod name, pod namespace}
today, e.g. https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/server/stats/prometheus_resource_metrics.go#L47.Errors like this will be returned when querying metrics:
There are 2 metrics affected by this:
So we should cherry-pick this to 1.13 and 1.14 to fix the issue.
/cc @dashpole @davidz627
Signed-off-by: Lantao Liu lantaol@google.com
What type of PR is this?
/kind bug
/kind failing-test