Can manually triggered cron jobs respect the concurrencyPolicy?
Note that concurrency policy only applies to the jobs created by the same cron job.
The concurrencyPolicy
field only applies to jobs created by the same cron job, as stated in the documentation: https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/#concurrency-policy
When executing $ kubectl create job my-job --namespace precompile --from=cronjob/my-cron-job
you are essentially creating a one-time job on its own that uses the spec.jobTemplate
field as a reference to create it. Since concurrencyPolicy
is a cronjob field, it is not even being evaluated.
TL;DR
This actually is the expected behavior. Manually created jobs are not effected by concurrencyPolicy
. There is no flag you could pass to change this behavior.