2

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 here and here).

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

Thank you

João Matos
  • 6,102
  • 5
  • 41
  • 76

1 Answers1

3

You need to deploy a job. A deployment is meant to keep the containers running all the time. Give a check on:

https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/