1

According to this page in K8S, "...two jobs might be created...".

If I set my concurrencyPolicy to "Forbid" - Will I still get optionally concurrent runs due to the scheduler, or will I get concurrent calls to run but be prevented?

I also opened an issue in the Docs site: https://github.com/kubernetes/website/issues/18655

mebius99
  • 2,495
  • 1
  • 5
  • 9

1 Answers1

1

Setting concurrencyPolicy to "Forbid" will make it so that if, by the time the next scheduled job comes around, the previous job is still running cron will not spin up another job and will count as a missed job. Setting it to "Allow" will allow these jobs to run at least once when scheduled.

There is only a chance of two jobs, or no job, being run at one scheduled time as K8S does not fully prevent this.

Nicholas Elkaim
  • 163
  • 1
  • 7
  • 1
    So it is as I feared? Having "Forbid" will not prevent a dual running Job, even though it's the whole idea? And do you have a link or something I can read more about this? – Shachar Silbert Jan 14 '20 at 15:12
  • That's just going off of this doc: https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/#cron-job-limitations Which is why K8S strongly recommends that your jobs be idempotent. Meaning that they will not be affected if another is running at the same time. – Nicholas Elkaim Jan 14 '20 at 18:31