Search code examples
openshift

How to get who or what turned off a pod?


We are currently trying to debug an issue with a pod and figured out that 6 other pod (not related) was turned off and would want to figure out when that happens and who or what turned it off (to see if it's related or not with the first issue). Is it possible to get this kind of information with openshift ?


Solution

  • These operations are typically recorded in the audit logs (if you have enabled those): https://docs.openshift.com/container-platform/4.7/security/audit-log-view.html

    So you can filter certain actions for example like so (GET actions):

    oc adm node-logs node-1.example.com --path=oauth-apiserver/audit.log \
      | jq 'select(.verb != "get")'