<p>I'm using preStop command to gracefully shutdown my server application when I delete a pod. What is the state of the pod/ container when it runs preStop command? For example, does it stop the network interfaces before running the preStop command? </p>

<pre><code>lifecycle:
    preStop:
      exec:                
        command: ["kill", "-SIGTERM", "`pidof java`"]
</code></pre>

<p>The state of the pod doesn't change while preStop hooks are run -- the preStop hook is run in the container, and then the container is stopped.</p>
