<p>I am looking for a solution where the running process inside the pod completes before deleting. Also, stop the service to send a new request to the terminating pod. But I am kind of confused between</p>
<pre><code>terminationGracePeriodSeconds 
</code></pre>
<p>and</p>
<pre><code>lifecycle:
        preStop:
          exec:
            command:
              - &quot;sleep&quot;
              - &quot;60&quot;
</code></pre>

Vikas Rathore
<p>Termination grace period and preStop hook are two different things. The grace period is the time the kubelet gives you to shut down gracefully (by handling TERM signals). The preStop hook can be used to run a command before the pod is shut down. If the preStop hook exceeds the grace period, it's given another 2 seconds to terminate.</p>
<p>That said, i wouldn't rely too much on graceful shutdowns. Pods live in a cold and hostile environment and can be killed anytime, you should be prepared for that.</p>
<p>More info on pod termination: <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#pod-termination</a></p>
