☑️ Prevent CronJob from executing jobs concurrency

By default, the cron job allows concurrently running jobs but generally speaking, the behavior of your cron jobs will be more deterministic if you prevent them from running concurrently. Allowing concurrent cron jobs often requires locking mechanisms (to avoid race conditions) in addition to startup/cleanup handling.

Targeted resources by this rule (types of kind): CronJob

Enabled by default? False

Policy as code identifier: CRONJOB_MISSING_CONCURRENCYPOLICY_KEY

This rule will fail

If a CronJob doesn't have concurrencyPolicy set or concurrencyPolicy is set to Allow

YAML
YAML

Rule output in the CLI

Terminal

How to fix this failure

Set concurrencyPolicy to either Forbid or Replace

YAML
YAML

Read more