Kubernetes CronJob concurrencyPolicy 是否按预期工作?

Does Kubernetes CronJob concurrencyPolicy works as expected?

由于 Kubernetes docs

A cron job creates a job object about once per execution time of its schedule. We say “about” because there are certain circumstances where two jobs might be created, or no job might be created. We attempt to make these rare, but do not completely prevent them. Therefore, jobs should be idempotent

但 CronJob 也有参数:concurrencyPolicy (Allow, Forbid)

那么我是否可以期望如果我设置 concurrencyPolicy=Forbid CronJob 将 运行 总是在单个实例中?

CronJob,在某些情况下,每个 运行 可以调度 多个作业,这是 CronJob 并发,默认设置为 Allow .

当您将策略设置为 Forbidit won't allow Jobs to be started until previous Jobs have completed or timed out

所以基本上,根据 Forbid 政策,如果之前的 运行 仍然有效,即将到来的工作将被跳过。