Kubernetes CronJob - Skip job if previous is still running AND wait for the next schedule time

10/7/2018

I have scheduled the K8s cron to run every 30 mins.

If the current job is still running and the next cron schedule has reached it shouldn't create a new job but rather wait for the next schedule.

And repeat the same process if the previous job is still in Running state.

-- k_vishwanath
cron
kubernetes
kubernetes-cronjob

1 Answer

10/7/2018

set the following property to Forbid in CronJob yaml

.spec.concurrencyPolicy

https://kubernetes.io/docs/tasks/job/automated-tasks-with-cron-jobs/#concurrency-policy

-- k_vishwanath
Source: StackOverflow