Cron Expression Generator for Kubernetes CronJobs
Table of Contents
Kubernetes CronJob resources use standard 5-field cron expressions in the schedule field of the YAML manifest. The good news: k8s uses the same format as Unix crontab, so any standard cron expression you build works directly.
Use our free cron expression generator to build your schedule, then paste it directly into your Kubernetes CronJob YAML.
Kubernetes CronJob YAML Structure
A Kubernetes CronJob manifest looks like this:
apiVersion: batch/v1
kind: CronJob
metadata:
name: daily-cleanup
spec:
schedule: "0 2 * * *" # 2 AM UTC every day
jobTemplate:
spec:
template:
spec:
containers:
- name: cleanup
image: my-cleanup-image:latest
restartPolicy: OnFailure
The schedule field accepts any valid 5-field cron expression. Kubernetes runs these in UTC by default — keep that in mind when scheduling time-sensitive jobs.
Common Kubernetes CronJob Schedules
These are the schedules most teams need for k8s CronJobs:
| Task | Schedule | Description |
|---|---|---|
| Database backup | 0 2 * * * | Daily at 2:00 AM UTC |
| Hourly sync | 0 * * * * | Top of every hour |
| Every 15 minutes | */15 * * * * | 0, 15, 30, 45 past each hour |
| Weekly report | 0 9 * * 1 | Monday at 9:00 AM UTC |
| Monthly billing run | 0 0 1 * * | 1st of month at midnight UTC |
| Weekday maintenance | 0 22 * * 1-5 | Weekdays at 10 PM UTC |
| Every 5 minutes | */5 * * * * | Health check or polling |
| Quarterly | 0 0 1 1,4,7,10 * | First of Jan, Apr, Jul, Oct |
Timezone Handling in Kubernetes CronJobs
Kubernetes CronJobs run in UTC by default. This is actually good practice — UTC doesn't change for daylight saving time, so your 2 AM backup stays at 2 AM UTC year-round.
But if your team thinks in local time, you need to convert. If you're in EST (UTC-5) and want a job at 9 AM local time, schedule it at 0 14 * * * (9 + 5 = 14:00 UTC).
Starting with Kubernetes 1.25, you can also use the timeZone field in the CronJob spec:
spec: schedule: "0 9 * * 1-5" timeZone: "America/New_York"
This is cleaner than mentally converting to UTC, but requires k8s 1.25+ and the cluster must have timezone data available. Check your cluster version before relying on this feature.
ConcurrencyPolicy: Preventing Overlapping Kubernetes Jobs
By default, Kubernetes will start a new Job even if the previous one is still running. For long-running jobs, this causes overlapping executions. Use concurrencyPolicy to control this:
spec: schedule: "*/5 * * * *" concurrencyPolicy: Forbid # Skip if previous is still running # Options: Allow (default), Forbid, Replace
- Allow — Start new job regardless of existing jobs running
- Forbid — Skip the new job if the previous one is still running
- Replace — Cancel the running job and start a new one
For database maintenance jobs, Forbid is usually the right choice. For event-processing jobs where you always want the latest run, Replace makes sense.
Debugging Kubernetes CronJob Timing Issues
If your CronJob isn't firing when you expect, check these common causes:
1. UTC vs local time confusion: Remember k8s runs in UTC unless you've set timeZone. A job at 0 9 * * * fires at 9 AM UTC, not your local 9 AM.
2. Check recent job history:
kubectl get cronjobs kubectl describe cronjob daily-cleanup kubectl get jobs --selector=job-name=daily-cleanup
3. Verify the expression itself: Paste it into our crontab visualizer to see the exact next run times before deploying.
4. Clock skew: If cluster nodes have out-of-sync clocks, jobs may fire late or be skipped. Check NTP settings on your nodes.
5. startingDeadlineSeconds: If a job misses its scheduled time by more than this many seconds (default: no limit), k8s counts it as a failure. Set it appropriately for jobs that can afford some delay:
spec: startingDeadlineSeconds: 300 # Up to 5 min late is OK
Try It Free — No Signup Required
Runs 100% in your browser. No account, no install, no limits.
Open Free Cron GeneratorFrequently Asked Questions
Does Kubernetes use 5-field or 6-field cron expressions?
Kubernetes uses standard 5-field cron expressions (minute, hour, day-of-month, month, day-of-week). It does not use Spring Boot's 6-field format with seconds. Any expression from a standard cron generator works directly in k8s CronJob YAML.
Does Kubernetes CronJob run in UTC?
Yes, Kubernetes CronJobs run in UTC by default. Starting with Kubernetes 1.25, you can add a timeZone field to the CronJob spec to use a named timezone like "America/New_York". Earlier versions require you to manually convert your desired local time to UTC.
How do I prevent a Kubernetes CronJob from running twice at the same time?
Set concurrencyPolicy: Forbid in your CronJob spec. This tells Kubernetes to skip the new job execution if the previous one is still running, preventing overlapping instances of long-running jobs.
What is the minimum interval for a Kubernetes CronJob?
The minimum interval is one minute, matching standard cron behavior. Kubernetes does not support sub-minute scheduling in CronJobs. If you need sub-minute scheduling, use a long-running pod with its own internal sleep/tick loop.

