BackendBench
Coffee

Home โ€บ Cron errors โ€บ Kubernetes

Kubernetes ยท silent bug

Kubernetes CronJob runs at the wrong time

Why this happens

Without spec.timeZone the schedule uses the controller's time zone, usually UTC. 09:00 UTC is 14:30 in India, not 09:00.

Wrong and right

wrong
0 9 * * *

Runs on: Fri 01 Jan, 09:00, Sat 02 Jan, 09:00, Sun 03 Jan, 09:00, Mon 04 Jan, 09:00, Tue 05 Jan, 09:00, Wed 06 Jan, 09:00, Thu 07 Jan, 09:00

fixed
30 3 * * *

At 03:30 UTC. First runs after 1 Jan 2027 (UTC): Fri 01 Jan, 03:30, Sat 02 Jan, 03:30, Sun 03 Jan, 03:30, Mon 04 Jan, 03:30, Tue 05 Jan, 03:30

How to fix it

  1. Set spec.timeZone: "Asia/Kolkata" (Kubernetes 1.27+) and keep 0 9 * * *.
  2. On older clusters, convert to UTC by hand: 09:00 IST is 30 3 * * *.
  3. Document the zone next to the schedule.

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 30 3 * * *:

SystemExpression
Quartz0 30 3 * * ?
Spring0 30 3 * * *
Crontab30 3 * * *
AWS EventBridge30 3 * * ? *
Jenkins30 3 * * *
GitHub Actions30 3 * * *
node-cron30 3 * * *
Apache Airflow30 3 * * *
Azure Functions0 30 3 * * *
Google Cloud Scheduler30 3 * * *

Try it yourself

The tester below starts with the fixed expression. Change it and watch the schedule update.

Your week at a glance
fewer more runs

Upcoming runs

#LocalUTCFrom now

Copy-ready code

Frequently asked questions

How do I know which zone my cluster uses?

Check the kube-controller-manager node time zone, or set spec.timeZone and stop depending on it.

More Kubernetes fixes

See the full Kubernetes cron builder or convert between formats.

More tools you might need