<p>i'm trying to find out how to get <code>preStop</code> execution result for debugging purposes. </p>

<p>I'm creating a pod (not part of a deployment) with the following lifecycle definition:</p>

<pre><code>   terminationGracePeriodSeconds: 60
   lifecycle:
      preStop:
        exec:
          command:
          - /bin/sh
          - -c
          - "echo trying post_stop;sleep 60"
</code></pre>

<p>when I ran it I can see it waiting 60 seconds but I cannot see any events for <code>preStop</code> hook being triggers not when I run <code>kubectl get events</code> and not when I run <code>kubectl describe pod &lt;my-pod&gt;</code>
more then that I would love to know where the logs of the hook is being written, I tried to run <code>kubectl logs &lt;my-pod&gt; -f</code> but I did not see any logs there</p>

Lior Baber
<p>You were on the right path with <code>kubectl describe</code>, check out the following location: <code>/dev/termination-log</code> see also the <a href="https://kubernetes.io/docs/tasks/debug-application-cluster/determine-reason-pod-failure/#writing-and-reading-a-termination-message" rel="nofollow noreferrer">docs</a>.</p>
