OpsPane

Generate a complete CronJob manifest with schedule, timeZone, concurrencyPolicy and history limits, explained field by field.

Time zone

In plain English

At 03:00.

Minute01/60

:00

Hour31/24

03:00

Day of month*31/31

Every day of the month

Month*12/12

Every month

Day of week*7/7

Every day of the week

Day matchAND

Runs every day.

Next 10 runs

Computed in your browser

Next run in—

Local timeUTCFrom now
———
———
———
———
———
———
———
———
———
———

CronJob settings

concurrencyPolicy
restartPolicy

CronJob manifest

Apply with kubectl apply -f cronjob.yaml.

cronjob.yaml (batch/v1)
Updated Runs locally in your browser

Quick answer

  • spec.schedule takes five cron fields, minute first with no seconds, or a macro from @hourly to @every 1h30m; robfig/cron parses it.
  • 7 for Sunday is rejected: use 0 or SUN.
  • spec.timeZone takes an IANA name (stable since 1.27); without it the schedule follows kube-controller-manager's zone, and TZ= or CRON_TZ= inside the schedule is rejected.
  • concurrencyPolicy: Allow (the default) runs overlapping Jobs side by side, Forbid skips the new run, Replace stops the running Job and starts the new one.

How to use

  1. Type the schedule in spec.schedule syntax and pick the time zone for spec.timeZone.
  2. Fill in the name, image and command, and choose what happens when runs overlap.
  3. Copy the manifest, save it as cronjob.yaml and run kubectl apply -f on it.

CronJob fields explained

FieldWhat it does
scheduleFive cron fields (or a macro) parsed by robfig/cron.
timeZoneIANA zone for the schedule; stable since 1.27. Default: the controller's zone.
concurrencyPolicyAllow, Forbid or Replace when a run is due while the last one is still running.
startingDeadlineSecondsDeadline for starting a missed run; empty means no deadline.
successfulJobsHistoryLimitFinished Jobs to keep (default 3).
failedJobsHistoryLimitFailed Jobs to keep (default 1).
suspendPauses new runs; already-running Jobs continue.
restartPolicyOnFailure 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:20
A 20-minute job due again after 10 minutes: Allow starts job #2 alongside job #1, while Forbid skips the run that came due at 10:10 and Replace stops job #1 first, starting job #2 in its place.

Schedule 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
Same schedule, two readings. Crontab requires both day fields to match: only the 9th and 23rd of March 2026 are odd days that are also Mondays. Kubernetes (robfig/cron) treats */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.

FAQ

How do I set a time zone for a Kubernetes CronJob?

Set spec.timeZone to an IANA name such as Europe/Berlin or Etc/UTC; the field is stable since Kubernetes 1.27. Without it, the schedule follows the time zone of kube-controller-manager. TZ= or CRON_TZ= inside spec.schedule is rejected.

What does concurrencyPolicy do?

It decides what happens when a run is due while the previous Job is still running: Allow starts another one, Forbid skips the new run, Replace stops the running Job and starts the new one.

What is startingDeadlineSeconds?

How many seconds late a missed run may still start, for example after the controller was down. Leave it empty for no limit. Values under 10 can stop the Job from ever being scheduled, because the controller checks every 10 seconds.

Is Sunday 0 or 7 in a CronJob schedule?

Kubernetes parses schedules with the Go library robfig/cron, which accepts 0–6 (or SUN–SAT) and rejects 7. Use 0 or SUN for Sunday.

How long can a CronJob name be?

At most 52 characters: the controller appends 11 characters to name each Job, and Job names are limited to 63. Use lowercase letters, digits and hyphens.

Why does my CronJob say it missed too many start times?

If the controller finds more than 100 missed schedules since the last run, it does not start the Job and logs an error. Setting startingDeadlineSeconds limits how far back it counts.

Private by design

Your input is processed in this browser tab and never sent to our servers. Privacy policy