Skip to content

Commit

Permalink
Print warning when OOMKiller occured
Browse files Browse the repository at this point in the history
By making tests with new MicroShfit release, some of our pods from time
to time got OOMKill, that later disturb the tests.
This commit will print a warning, when the pod was killed by the
OOMKiller, so we can increase the resources.

Change-Id: I10d7163f20486e9764d2f8b51c8aa0301b05995e
  • Loading branch information
danpawlik committed Oct 31, 2024
1 parent 4ca4aa1 commit e0fa13f
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions roles/post/get-k8s-cluster-resources/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,14 @@
- pv
tags:
skip_ansible_lint

- name: Check if some pod was OOMKilled
ansible.builtin.shell: |
kubectl get events --all-namespaces --sort-by='.lastTimestamp' -A | grep -i oom | tee {{ output_dir }}/oomkilled.log
register: _oomkill_status
ignore_errors: true

- name: Print warning message when OOMKill occured
ansible.builtin.shell: |
echo -e "\n\n\n\nOOMKill occured!\n{{ _oomkill_status.stdout }}\n\n\n\n"
when: _oomkill_status.stdout | length > 0

0 comments on commit e0fa13f

Please sign in to comment.