Convert cron to Kubernetes CronJob

This page shows how to write a standard five-field Unix cron schedule as a Kubernetes CronJob schedule. Every example below is produced by the CronLabs engine. To convert an expression of your own, open the interactive converter.

Example conversions

Each row shows a common cron expression, what it does, and the equivalent Kubernetes CronJob schedule.

CronMeaningKubernetes CronJob
0 9 * * *at 9:00 AM0 9 * * *
*/15 * * * *every 15 minutes*/15 * * * *
0 9 * * 1-5at 9:00 AM on weekdays0 9 * * 1-5
0 0 * * 0Every Sunday at midnight0 0 * * 0
0 0 1 * *First day of every month at midnight0 0 1 * *
30 2 * * *at minute 30 at 2:30 AM30 2 * * *

Ready-to-use Kubernetes CronJob configuration

The snippet below schedules a job for at 9:00 AM on weekdays (cron 0 9 * * 1-5). Replace the placeholder command and names with your own values.

Kubernetes CronJob · yaml
apiVersion: batch/v1
kind: CronJob
metadata:
  name: my-job
spec:
  schedule: "0 9 * * 1-5"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: my-job
              image: busybox:latest
              command: ["/bin/sh", "-c", "/path/to/job"]
          restartPolicy: OnFailure

Things to know about Kubernetes CronJob schedules

Set spec.timeZone to pin a zone (Kubernetes ≥ 1.27); otherwise the controller-manager's timezone is used.

For the full syntax, see the official Kubernetes CronJob documentation.

Convert your own expression

Paste any cron expression into the validator to see its next run times, a calendar view, and the equivalent schedule for every supported platform.

Open the validator

Convert cron to other platforms