<p>we have a deployment with hpa(horizontal pod autoscaling) of maxReplicas set to 3. And in our deployment.yaml we have a preStop hook defined, which calls an API exposed in the container and a terminationGracePeriodInSeconds defined to 60 seconds(the calls are internal to the cluster and should be sufficient).
Is it guaranteed that the preStop hook waits for the execution of the request from all three pods?</p>
<pre><code>     lifecycle:
       preStop:
         exec:
           command: [ &quot;curl&quot;, &quot;-XPOST&quot;, http://$SERVICE_NAME:$PORT_NUMBER/exit-gracefully ]
   terminationGracePeriodSeconds: 60  ```
</code></pre>

Reddy_73
<p>No guaranteed as the <a href="https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks" rel="nofollow noreferrer">official document</a> stated:</p>
<blockquote>
<p>The Pod's termination grace period countdown begins before the PreStop
hook is executed, so regardless of the outcome of the handler, the
container will <strong>eventually terminate within the Pod's termination grace
period</strong>.</p>
</blockquote>
