<p>I want my pods to be gracefully recycled from my deployments after certain period of time such as every week or month. I know I can add a cron job for that if I know the Kubernetes command. </p>

<p>The question is what is the best approach to do this in Kubernetes. Which command will let me achieve this goal?</p>

<p>Thank you very much for helping me out on this.</p>

<p>As the <a href="https://stackoverflow.com/users/1527879/rayhan">OP rayhan</a> has <a href="https://stackoverflow.com/a/53947838/6309">found out</a>, and as commented in <a href="https://github.com/kubernetes/kubernetes/issues/13488#issuecomment-446101458" rel="noreferrer"><code>kubernetes/kubernetes</code> issue 13488</a>, a kubectl patch of an environment variable is enough.</p>

<p>But... K8s 1.15 will bring <a href="https://github.com/kubernetes/kubernetes/issues/13488#issuecomment-481023838" rel="noreferrer"><code>kubectl rollout restart</code></a>... that is when <a href="https://github.com/kubernetes/kubernetes/pull/77423" rel="noreferrer">PR 77423</a> is accepted and merged.</p>

<blockquote>
  <p><code>kubectl rollout restart</code> now works for daemonsets and statefulsets.</p>
</blockquote>
