<p>I am trying to add preStop hook to my k8s container but for some reason sleep seems like it does not work. I tried to add echo and in that case I can see that it work. But when I replace echo with sleep it seems like it does not work and sleep because pod is removed before given number of seconds in the sleep command.</p>
<pre><code>lifecycle:
        preStop:
          exec:
            command:
              - sleep 60
</code></pre>
<p>Note than my gracefulTerminationPeriod is above 60.</p>
<p>Also I wonder if my app can send http request to outside of the pod during this period.</p>
<p>What is wrong here actually ?</p>

user1474111
<p>see doc
<a href="https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/attach-handler-lifecycle-event/</a></p>
<p>command and args much write in array format, you cannot just use space</p>
<pre class="lang-yaml prettyprint-override"><code>lifecycle:
        preStop:
          exec:
            command:
              - sleep
              - 60
</code></pre>
