Home โบ Cron errors โบ Kubernetes
Kubernetes CronJob does not support seconds
The CronJob "my-job" is invalid: spec.schedule: Invalid value: "*/30 * * * * *": expected exactly 5 fields, found 6Why this happens
CronJob schedules use five fields, so the finest interval is one minute.
Wrong and right
*/30 * * * * *Our parser says: Kubernetes CronJob needs 5 fields, but you gave 6
* * * * *Every minute. First runs after 1 Jan 2027 (UTC): Fri 01 Jan, 00:01, Fri 01 Jan, 00:02, Fri 01 Jan, 00:03, Fri 01 Jan, 00:04, Fri 01 Jan, 00:05
How to fix it
- Use a five-field schedule such as * * * * *.
- For sub-minute work, run a long-lived Deployment with its own timer.
- Do not paste Spring or Quartz expressions into a CronJob.
The Kubernetes format at a glance
Fields in order: minute (0-59), hour (0-23), day-of-month (1-31), month (1-12), day-of-week (0-7, 0 and 7 = Sunday).
Set spec.timeZone (Kubernetes 1.27+) to a name like Asia/Kolkata. Without it the schedule follows the controller's time zone, usually UTC.
The fixed schedule in other systems
If you are moving this schedule to another scheduler, these are the equivalents of * * * * *:
| System | Expression |
|---|---|
| Quartz | 0 * * * * ? |
| Spring | 0 * * * * * |
| Crontab | * * * * * |
| AWS EventBridge | * * * * ? * |
| Jenkins | * * * * * |
| GitHub Actions | * * * * * |
| node-cron | * * * * * |
| Apache Airflow | * * * * * |
| Azure Functions | 0 * * * * * |
| Google Cloud Scheduler | * * * * * |
Try it yourself
The tester below starts with the fixed expression. Change it and watch the schedule update.
Your week at a glance
Upcoming runs
| # | Local | UTC | From now |
|---|
Copy-ready code
Frequently asked questions
Can I run a CronJob every 30 seconds?
Not directly. Either run two CronJobs with a sleep, or use a Deployment that loops.
More Kubernetes fixes
See the full Kubernetes cron builder or convert between formats.