<p>I have <code>Deployment</code> that runs 5 pods.</p>

<p>I want to restart all pods each 5min.</p>

<p>Currently I'm doing it with python scritpt that is running <code>kubectl get po</code> and checks AGE, if the AGE bigger than 5 min it deletes the pod.</p>

<p>Is there another way to achieve that?</p>

samisaviv
<p>You could do a liveness check to achieve this, but why would you do it? Deployment is for LongRunning Tasks.</p>

<p>A liveness check will reschedule a pod if its not true (gives a other exit code than 0)</p>

<p>For more Info here:</p>

<p><a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/</a></p>
