Skip to content

[multiple] Add OOMKill log#3776

Open
danpawlik wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
danpawlik:add-oom-kill-info
Open

[multiple] Add OOMKill log#3776
danpawlik wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
danpawlik:add-oom-kill-info

Conversation

@danpawlik
Copy link
Contributor

@danpawlik danpawlik commented Mar 18, 2026

It might happen that there would be an OOMKill of the container.
We would like to be aware about that issue.

@danpawlik danpawlik requested review from a team, arxcruz, averdagu and fmount March 18, 2026 14:29
@danpawlik danpawlik force-pushed the add-oom-kill-info branch 2 times, most recently from 2c71749 to fdad102 Compare March 18, 2026 14:31
@averdagu
Copy link
Contributor

Looks good to me. Did we found any occurrence of this?

@danpawlik
Copy link
Contributor Author

@averdagu in some cases, we see that tempest tests can not pass, where we wondering what can be root cause of it. Maybe it is oomkill, maybe bad health check? Something to discover. We just want to more aware whats going on.

@averdagu
Copy link
Contributor

/lgtm

evallesp
evallesp previously approved these changes Mar 18, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 18, 2026

New changes are detected. LGTM label has been removed.

Copy link
Contributor

@fmount fmount left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not against the idea of being aware of any OOMKill that might happen in the cluster, but I think just getting the events is not enough to have a clear idea of the nodes status.
Instead considering to stores the output of oc describe nodes that contains more data about Conditions and Capacity and can drive through a resolution of the problem.

- name: Check if there were some OOMKill
ansible.builtin.shell: >
oc get events
--all-namespaces
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

--all-namespaces in a large environment might take a bit, and I'm not sure you need to check which Pod is oomikilled all over the cluster.
Did you try in a DC or DZ environment?
Perhaps you can consider running the regular openshift must gather along with the openstack one if you're looking for this kind of data. [1]

[1] e.g.

oc adm must-gather \
   --image-stream=openshift/must-gather \
   --image=quay.io/openstack-k8s-operators/openstack-must-gather:latest

If you get OOMKill all over the cluster I expect must-gather does not work and you've probably lost access to the OCP API at this point.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How in quick way, I would be able to get information that there was an OOMKill without downloading 1GB logs and make grep? Does must gather provide a dedicated file with OOMKIll log?

@danpawlik
Copy link
Contributor Author

danpawlik commented Mar 20, 2026

@fmount I can add the --field-selector type=Warning - why not. I see it is suggested by AI, where Stackoverflow have just simplier way :)

You can get the json and use jq to filter the "Reason" you're interested to, but to me that kind of post- processing should happen later, as an additional task, on the gathered file.

still, I need to download a file, use jq or other tool, grep instead of take a look into a dedicated file. Such way we can consider if OOMKill would be often - something to decide in the future.

Instead considering to stores the output of oc describe nodes that contains more data about Conditions and Capacity and can drive through a resolution of the problem.

So far, we just want to see OOMKill. We can add other info in other PR if needed.

@fmount
Copy link
Contributor

fmount commented Mar 20, 2026

@fmount I can add the --field-selector type=Warning - why not. I see it is suggested by AI, where Stackoverflow have just simplier way :)

What? I don't think the point is AI vs stackoverflow vs #anythingelse. the point is that sorting by time doesn't make sense to me. So please stop with that.

You can get the json and use jq to filter the "Reason" you're interested to, but to me that kind of post- processing should happen later, as an additional task, on the gathered file.

still, I need to download a file, use jq or other tool, grep instead of take a look into a dedicated file. Such way we can consider if OOMKill would be often - something to decide in the future.

-o json | jq is what I meant.

Instead considering to stores the output of oc describe nodes that contains more data about Conditions and Capacity and can drive through a resolution of the problem.

So far, we just want to see OOMKill. We can add other info in other PR if needed.

Still I don't think that a query to all-namespaces is the right way. If your etcd, or apiserver or any other kubernetes infra pod gets oomkilled, these tasks are useless.

Feel free to move forward w/ this, but I'm -1 with the idea, believe I'm an AI or not.

@danpawlik
Copy link
Contributor Author

@fmount I can add the --field-selector type=Warning - why not. I see it is suggested by AI, where Stackoverflow have just simplier way :)

What? I don't think the point is AI vs stackoverflow vs #anythingelse. the point is that sorting by time doesn't make sense to me. So please stop with that.

You can get the json and use jq to filter the "Reason" you're interested to, but to me that kind of post- processing should happen later, as an additional task, on the gathered file.

still, I need to download a file, use jq or other tool, grep instead of take a look into a dedicated file. Such way we can consider if OOMKill would be often - something to decide in the future.

-o json | jq is what I meant.

Instead considering to stores the output of oc describe nodes that contains more data about Conditions and Capacity and can drive through a resolution of the problem.

So far, we just want to see OOMKill. We can add other info in other PR if needed.

Still I don't think that a query to all-namespaces is the right way. If your etcd, or apiserver or any other kubernetes infra pod gets oomkilled, these tasks are useless.

Feel free to move forward w/ this, but I'm -1 with the idea, believe I'm an AI or not.

so you just want to collect openstack namespace OOMKill instead of all namespaces, so I need to create new task in other place where I will collect those info. Make sense

@danpawlik danpawlik changed the title [os_must_gather] Add OOMKill log [multiple] Add new role for collecting OpenShift cluster info Mar 20, 2026
@danpawlik
Copy link
Contributor Author

danpawlik commented Mar 20, 2026

we have an agreement with @fmount that collecting cluster logs/state info should be in other place than os_must_gather role or at least separate task file.

@danpawlik danpawlik force-pushed the add-oom-kill-info branch 2 times, most recently from 49639e1 to 6c1e8e2 Compare March 20, 2026 11:35
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 20, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign evallesp for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@danpawlik danpawlik changed the title [multiple] Add new role for collecting OpenShift cluster info [os_must_gather] Add OOMKill log Mar 23, 2026
It might happen that there would be an OOMKill of the container.
We would like to be aware about that issue.

Signed-off-by: Daniel Pawlik <dpawlik@redhat.com>
@danpawlik danpawlik changed the title [os_must_gather] Add OOMKill log [multiple] Add OOMKill log Mar 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants