How to use
- Type the schedule in
spec.schedulesyntax and pick the time zone forspec.timeZone. - Fill in the name, image and command, and choose what happens when runs overlap.
- Copy the manifest, save it as
cronjob.yamland runkubectl apply -fon it.
CronJob fields explained
| Field | What it does |
|---|---|
schedule | Five cron fields (or a macro) parsed by robfig/cron. |
timeZone | IANA zone for the schedule; stable since 1.27. Default: the controller's zone. |
concurrencyPolicy | Allow, Forbid or Replace when a run is due while the last one is still running. |
startingDeadlineSeconds | Deadline for starting a missed run; empty means no deadline. |
successfulJobsHistoryLimit | Finished Jobs to keep (default 3). |
failedJobsHistoryLimit | Failed Jobs to keep (default 1). |
suspend | Pauses new runs; already-running Jobs continue. |
restartPolicy | OnFailure retries inside the pod; Never creates a new pod per retry. |
When a run is still going: concurrencyPolicy
When the next run comes due while the previous one is still running, what happens is decided by concurrencyPolicy: Allow (the default) runs them side by side, Forbid skips the run that came due, and Replace stops the running job first and starts the new one in its place.
*/10 * * * *job takes 20 min · window 10:00–10:20Schedule syntax in Kubernetes
The CronJob controller parses spec.schedule with the Go library robfig/cron. It takes the usual five fields plus @hourly, @daily, @weekly, @monthly, @yearly and @every 1h30m. Unlike Linux crontab it rejects 7 for Sunday.
Both day fields are set: AND or OR
*/2 in a day field is a restriction rather than a full wildcard, so 0 0 */2 * 1 runs on odd days or Mondays under robfig/cron, while Linux crontab requires both to match — only the 9th and 23rd of March 2026 are odd days that are also Mondays. The Cron Expression Explainer shows both readings side by side.
0 0 */2 * 1day-of-month */2 and day-of-week 1 · March 2026*/2 as a restriction too and runs when either matches — 19 runs.Time zones and daylight saving
Set spec.timeZone to an IANA name; the tool previews the runs in that zone. Like crontab, robfig/cron skips a time that does not exist when clocks spring forward and runs a repeated time twice when they fall back. In zones with a 30-minute daylight-saving change (Lord Howe Island) it can also skip a run on the change day — the warnings show exactly which.
How the results are verified
Schedules and next runs are checked against robfig/cron v3.0.1, the library the CronJob controller uses, on 316 expression, time-zone and start-time combinations. Field rules and limits follow the Kubernetes CronJob documentation.