Kubernetes cron schedules
A Kubernetes CronJob reads five-field cron in spec.schedule and starts a Job for each run. Pick a schedule for the exact expression, config you can paste and the next run times.
Schedules
- Every 5 minutes
*/5 * * * * - Every hour
0 * * * * - Every minute
* * * * * - Every 10 minutes
*/10 * * * * - Every 15 minutes
*/15 * * * * - Every 30 minutes
*/30 * * * * - Daily at midnight
0 0 * * * - Daily at 9 am
0 9 * * * - Weekdays at 9 am
0 9 * * 1-5 - Every Monday
0 0 * * 1 - First day of the month
0 0 1 * * - Every 6 hours
0 */6 * * * - Every Sunday at midnight
0 0 * * 0 - Every 2 hours
0 */2 * * * - Every 12 hours
0 */12 * * * - Daily at noon
0 12 * * * - Every Friday
0 0 * * 5 - Last day of the monthCan’t convert
- Every quarter
0 0 1 */3 * - Every 2 minutes
*/2 * * * * - Every 3 hours
0 */3 * * * - Daily at 6 am
0 6 * * * - Daily at 6 pm
0 18 * * * - Twice a day
0 */12 * * * - Weekdays at 6 pm
0 18 * * 1-5 - Weekends at 10 am
0 10 * * 0,6 - 15th of the month
0 0 15 * * - First Monday of the monthCan’t convert
- Last Friday of the monthCan’t convert
- Once a year
0 0 1 1 * - Every 30 secondsCan’t convert
- Every 3 minutes
*/3 * * * * - Every 20 minutes
*/20 * * * * - Every 4 hours
0 */4 * * * - Every 8 hours
0 */8 * * * - Daily at 1 am
0 1 * * * - Daily at 2 am
0 2 * * * - Daily at 3 am
0 3 * * * - Daily at 8 am
0 8 * * * - Every weekday
0 0 * * 1-5 - Every weekend day
0 0 * * 0,6 - Every Tuesday
0 0 * * 2 - Every Wednesday
0 0 * * 3 - Every Thursday
0 0 * * 4 - Every Saturday
0 0 * * 6 - Every 6 months
0 0 1 */6 * - Every 10 secondsCan’t convert
- Every 5 secondsCan’t convert
Kubernetes gotchas
Day of week is 0-6The schedule parser stops at 6. Write 0 for Sunday; 7 is an error.
Too many missed startsIf a CronJob misses more than 100 starts, the controller stops starting it. Set startingDeadlineSeconds so old misses stop counting.
Overlapping runsconcurrencyPolicy defaults to Allow, so a slow Job can overlap the next one. Use Forbid or Replace.
*/n in a day field counts as setOnly * or ? leave a day field open. 0 0 */2 * 1 runs on odd days or on Mondays, while Vixie cron reads it as odd days that are Mondays.
Convert to and from Kubernetes
Convert Kubernetes cron to crontabConvert crontab cron to KubernetesConvert Kubernetes cron to GitHub ActionsConvert GitHub Actions cron to KubernetesConvert Kubernetes cron to AWS EventBridgeConvert AWS EventBridge cron to KubernetesConvert Kubernetes cron to SpringConvert Spring cron to KubernetesConvert Kubernetes cron to QuartzConvert Quartz cron to Kubernetes
FAQ
Which time zone does a Kubernetes schedule use?
Without spec.timeZone, in the local zone of kube-controller-manager, which is usually UTC. Set spec.timeZone (stable since Kubernetes 1.27) to an IANA name. CRON_TZ or TZ inside schedule is rejected.
Does a CronJob support @daily?
Yes. @yearly, @monthly, @weekly, @daily and @hourly work in spec.schedule.
Why did my CronJob run twice, or not at all?
A CronJob creates about one Job per scheduled time, not exactly one. Make the Job safe to repeat, and check startingDeadlineSeconds and concurrencyPolicy.