2

In the kubernetes documentation there is the following note at the page https://kubernetes.io/docs/concepts/workloads/controllers/jobs-run-to-completion/

Note that even if you specify .spec.parallelism = 1 and .spec.completions = 1 and .spec.template.spec.restartPolicy = "Never", the same program may sometimes be started twice.

Can this be avoided? E.g.: can we make sure that a job is started only at-most-once?

Thanks.

Eyal Levin
  • 16,271
  • 6
  • 66
  • 56
testTester
  • 2,371
  • 3
  • 18
  • 22

1 Answers1

0

No, the kubernetes job controller machinery does not support at-most-once or exactly-once semantics. There are various race and failure conditions that at-most-once and exactly-once would have to protect against. All the kube controllers do is periodically reconcile what they detect about the state of the cluster against spec.

Jonah Benton
  • 3,598
  • 1
  • 16
  • 27