<p>When I am in local, with minikube, I checked that each time I rebuild my app, and roll it out with : </p>

<pre><code>kubectl rollout restart deployment/api-local -n influx
</code></pre>

<p>The container lasts 30 sec to be terminated. I have no problem for production matters, but in local dev, I end losing a lot of time waiting, as I can rebuild my app 100 times maybe ( = losing 50 minutes a day ).</p>

<p>Is there some trick to shorten this terminating time ? I understand this would not be part of k8s best practices, but it would make sense to me.</p>

Juliatzin
<p>Set the <code>terminationGracePeriodSeconds</code> in the deployment/pod configuration. Per the <a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.10/#pod-v1-core" rel="nofollow noreferrer">reference docs</a>, it is:</p>

<blockquote>
  <p>...Optional duration in seconds the pod needs to terminate gracefully.
  May be decreased in delete request. Value must be non-negative
  integer. The value zero indicates delete immediately. If this value is
  nil, the default grace period will be used instead. The grace period
  is the duration in seconds after the processes running in the pod are
  sent a termination signal and the time when the processes are forcibly
  halted with a kill signal. Set this value longer than the expected
  cleanup time for your process. Defaults to 30 seconds.</p>
</blockquote>

<p>Example:</p>

<pre><code>spec:
  replicas: 1
  selector:
    ...
  template:
    spec:
      terminationGracePeriodSeconds: 0
      containers:
      ...
</code></pre>

<p>Also, from <a href="https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods" rel="nofollow noreferrer">here</a>:</p>

<blockquote>
  <p>The kubectl delete command supports the --grace-period=
  option which allows a user to override the default and specify their
  own value. The value 0 force deletes the Pod. You must specify an
  additional flag --force along with --grace-period=0 in order to
  perform force deletions.</p>
</blockquote>

<p>Example (specify the namespace, if needed):</p>

<pre><code>kubectl delete pod &lt;pod-name&gt; --now
</code></pre>

<p>...or</p>

<pre><code>kubectl delete pod &lt;pod-name&gt; --grace-period=0 --force
</code></pre>
