<h3>What I am trying to do:</h3>

<p>The app that runs in the Pod does some refreshing of its data files on start.
I need to restart the container each time I want to refresh the data.
(A refresh can take a few minutes, so I have a Probe checking for readiness.)</p>

<h3>What I <em>think</em> is a solution:</h3>

<p>I will run a <a href="http://kubernetes.io/docs/user-guide/scheduled-jobs/" rel="noreferrer">scheduled job</a> to do a <em>rolling-update</em> kind of deploy, which will take the old Pods out, one at a time and replace them, without downtime.</p>

<h3>Where I'm stuck:</h3>

<p>How do I trigger a deploy, if I haven't changed anything??</p>

<p>Also, I need to be able to do this from the scheduled job, obviously, so no manual editing..</p>

<p>Any other ways of doing this?</p>

<p>As of kubectl 1.15, you can run:</p>

<pre><code>kubectl rollout restart deployment &lt;deploymentname&gt;
</code></pre>

<p>What this does internally, is patch the deployment with a <code>kubectl.kubernetes.io/restartedAt</code> annotation so the scheduler performs a rollout according to the deployment update strategy.</p>

<p>For previous versions of Kubernetes, you can simulate a similar thing:</p>

<pre><code> kubectl set env deployment --env="LAST_MANUAL_RESTART=$(date +%s)"  "deploymentname"
</code></pre>

<p>And even replace all in a single namespace:</p>

<pre><code> kubectl set env --all deployment --env="LAST_MANUAL_RESTART=$(date +%s)" --namespace=...
</code></pre>
