← All notes

Kubernetes CronJobs

Answer: A CronJob creates Jobs on a repeating schedule written in cron syntax, for tasks like backups, report generation or cleanup. Each CronJob is like one line in a crontab file.

Example

apiVersion: batch/v1
kind: CronJob
metadata: {name: hello}
spec:
  schedule: "*/5 * * * *"
  timeZone: "America/Los_Angeles"
  concurrencyPolicy: Forbid
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
          - name: hello
            image: busybox
            command: ["date"]

Watch it

kubectl get cronjob hello
kubectl get jobs --watch

Caveats

Jobs should be idempotent: in some circumstances a CronJob can create more than one Job for a schedule, or skip one.

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted).

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Kubernetes Authors, CronJob, CC BY 4.0 (kubernetes/website); Kubernetes Authors, Running Automated Tasks with a CronJob, CC BY 4.0 (kubernetes/website).

Cite this

Permanent ID: iil:note:gzpwcd73

iinventedlight. 2026. "Kubernetes CronJobs." iinventedlight Library, iil:note:gzpwcd73, version of 2026-11-04. https://iinventedlight.com/library/notes/kubernetes-cronjobs/. License: CC-BY-4.0.

@misc{iil_note_gzpwcd73,
  author = {{iinventedlight}},
  title = {{Kubernetes CronJobs}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-04},
  url = {https://iinventedlight.com/library/notes/kubernetes-cronjobs/},
  note = {Permanent ID iil:note:gzpwcd73. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com.

For language models and agents: start at /llms.txt. This page in Markdown: /library/notes/kubernetes-cronjobs.md.