-
Notifications
You must be signed in to change notification settings - Fork 39.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
kubelet: expose OOM metrics #108004
kubelet: expose OOM metrics #108004
Conversation
cAdvisor has code to expose OOM metrics since 0.40.0, but this was not included in Kubelet so far. This commit enables it. Signed-off-by: Jorik Jonker <jorik.jonker@eu.equinix.com>
Welcome @jonkerj! |
Hi @jonkerj. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
/ok-to-test |
/test pull-kubernetes-e2e-gce-ubuntu-containerd |
I'll amend my PR to expand |
/test pull-kubernetes-node-e2e-containerd |
@wzshiming is there anything else I can do? |
kubernetes/vendor/github.com/google/cadvisor/metrics/prometheus.go Lines 1760 to 1769 in c6452be
I looked at PR of the metric that was added last time, and also looked at the context and it does work, look be fine. /lgtm /assign @klueska |
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.
Can we have a test in e2e?
I think testing for actual OOMs getting counted (ie, launch a well crafted pod eating memory) will be very convoluted and even error prone (it should use a well known image and it should consistently trip OOM after the init phase), so I included a test for metric presence in If more is needed, I'd like to have suggestions on what to do, because I honestly would not know where to start. |
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.
/priority backlog
/triage accepted
/lgtm
/assign @dashpole
does this seem reasonable?
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jonkerj, mrunalp, wzshiming 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 |
The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass. This bot retests PRs for certain kubernetes repos according to the following rules:
You can:
/retest |
i think cadvisor exposes a ton of metrics, not all are exposed through kubelet. should we in future consider exposing cadvisor metrics using a config file passed to kubelet ? |
What type of PR is this?
/kind feature
What this PR does / why we need it:
cAdvisor has code to expose the OOM metric
container_oom_events_total
since 0.40.0, which is included in kubelet since 1.23.0, but this was not activated in Kubelet coede.Which issue(s) this PR fixes:
Fixes # (n/a, if needed, let me know and I'll raise a ticket)
Special notes for your reviewer:
My test environment is Talos 0.14.x, with k8s 1.23.3, so I tested it by:
make WHAT=cmd/kubelet
fromgolang:1.17-buster
talos-systems/kubelet
docker.io/jonkerj/talos-kubelet:0.0.2
The nodes running that specific Kubelet expose the metric, and I see the metric increasing if I go beyond memory resource limits (using
stress-ng
).Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: