<p>I have a pod that is meant to run a code excerpt and exit afterwards. I do not want this pod to restart after exiting, but apparently it is not possible to set a restart policy in Kubernetes (see <a href="https://github.com/kubernetes/kubernetes/issues/24725" rel="nofollow noreferrer">here</a> and <a href="https://stackoverflow.com/a/55169169/4828060">here</a>).</p>

<p>Therefore my question is: how can I implement a pod that runs only once?</p>

<p>Thank you</p>

João Matos
<p>You need to deploy a job. A deployment is meant to keep the containers running all the time. Give a check on: </p>

<p><a href="https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/</a></p>
