<p>I currently have the following lifecycle hook in my kubernetes config:</p>

<pre><code>lifecycle:
      preStop:
        httpGet:
          path: /path
          port: 8080
</code></pre>

<p>I would like to call the shutdown endpoint of spring boot actuator in this hook, but this endpoint requires a post request instead of a get. Is this in any way possible or should I define my own endpoint that shuts down my app gracefully?</p>

<p>Thanks for your help! </p>

<p>You can add an <code>exec</code> lifecycle hook since <code>httpPost</code> is not a valid one, and assuming you have <code>curl</code> in your containers:</p>

<pre><code>lifecycle:
  preStop:
    exec:
      command: ["curl", "-XPOST", "http://URL"]
</code></pre>
