Kubernetes CronJob syntax: how K8s cron scheduling differs from Linux cron
Kubernetes CronJobs are the standard way to run scheduled workloads in K8s. The cron syntax is identical to Linux. The concurrency, history, and deadline policies are where you need to think differently from a traditional crontab. Set concurrencyPolicy explicitly, then keep the 3 successful and 1 failed history defaults or override them to match your retention needs.
Kubernetes CronJobs use the standard 5-field cron syntax with optional spec fields around it. To run at local midnight, use schedule: '0 0 * * *' with timeZone: 'America/New_York'. The field is .spec.timeZone. Putting CRON_TZ or TZ inside .spec.schedule isn't supported and fails validation.
By TechCompare · Updated
How this is calculated
Kubernetes adds three features on top of standard cron: concurrencyPolicy (Forbid, Replace, or Allow) controls what happens when a previous Job is still running, successfulJobsHistoryLimit and failedJobsHistoryLimit control how many finished Jobs are retained, and startingDeadlineSeconds sets a tolerance for missed schedules. The history limits default to 3 successful Jobs and 1 failed Job. Each CronJob invocation creates a Job, which then starts one or more Pods. An every-5-minutes schedule creates 288 Jobs per day, but the controller cleans finished history down to the configured limits.
Verdict
The cron string is portable, but Kubernetes changes the operational model in ways that matter. Each invocation creates a Job and its Pods, so an every-5-minutes schedule starts 288 Jobs daily. Forbid on concurrencyPolicy prevents overlap. The default successfulJobsHistoryLimit of 3 and failedJobsHistoryLimit of 1 keep finished Jobs from growing without limit, and you can set either value to 0 for no retained history. startingDeadlineSeconds controls how late a missed run may start.
More Cron scenarios
Related guides
Frequently asked questions
Is Kubernetes CronJob syntax the same as Linux cron?
What does concurrencyPolicy do on a Kubernetes CronJob?
How do I stop completed CronJob pods from piling up?
Related tools
Unix Timestamp
Convert between Unix timestamps and human-readable dates.
Use tool ➜CHMOD Configurator
Calculate Linux file permissions using checkboxes or octal numbers, then view the matching symbolic notation.
Use tool ➜Text Encoding Converter
Convert between Text, Base64, Binary, Hexadecimal, and Decimal formats.
Use tool ➜