<p>Business requirement is following:</p>

<ol>
<li>Stop running container</li>
<li>Modify environment (Ex.Change value of DEBUG_LEVEL environment variable)</li>
<li>Start container</li>
</ol>

<p>This is easily achievable using docker CLI</p>

<p><code>docker create/docker stop/docker start</code></p>

<p>How to do it using kubernetes?</p>

<p>Additional info:
We are migrating from Cloud Foundry to Kubernetes. In CF, you <strong>deploy application</strong>, <strong>stop application</strong>, <strong>set environment variable</strong>, <strong>start application</strong>. The same functionality is needed.
For those who are not aware of CF application. It is like docker container with single running (micro)service.</p>

<p>Typically, you would run your application as a Deployment or as a StatefulSet. In this case, just change the value of the environment variable in the template and reapply the Deployment (or StatefulSet). Kubernetes will do the rest for you.</p>

<p>click here to refer the <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#updating-a-deployment" rel="nofollow noreferrer">documentation</a></p>
