Kubernetes CronJobs Failed with Error "too many missed start time (> 100)"
Problem
The Kubernetes cronjobs failed to start with an error mentioned below
Environment
Platform9 Managed Kubernetes - All Versions
CronJobs
Cause
For every cronjob, CronJob Controller checks how many schedules it missed in the duration from its last scheduled time until now. If there are more than 100 missed schedules, then it does not start the job and logs the error mentioned below.
The CronJob failures can occur if the
CronJob'sstatus.lastScheduleTime,metadata.creationTimestampfields are unset.Kubernetes first looks at the
lastScheduleTimefield to calculate how many jobs may have been missed. If that field is unset (such as for a newly createdCronJob), it uses thecreationTimestampfield in the metadata.
Resolution
The solution to this is recreating the failed cronjob as it will help to reset the null values for the
spec.jobTemplate.metadata.creationTimestampandspec.jobTemplate.spec.template.metadata.creationTimestampfields.
