Do not restart cron on failure in kubernetes

You have to set:

backoffLimit: 0 

restartPolicy: Never 

concurrencyPolicy: Forbid.

backoffLimit means the number of times it will try before it is considered failed. The default is 6.

concurrencyPolicy set to Forbid means it will run 0 or 1 times, but not more.

restartPolicy set to Never means it won’t restart on failure.

You need to do all 3 of these things, or your cronjob may run more than once.

Leave a Reply

Your email address will not be published. Required fields are marked *