Pcornel
Browse topics
Options
Recent
Favorites
Automation · Technical reference

CronJobs

Direct answer

CronJobs run Kubernetes Jobs on a cron schedule, such as nightly backups or reports, with settings for concurrency, history limits and starting deadlines.

When to use this

Use this when running scheduled jobs in Kubernetes.

First 30 seconds

1. CronJobs schedule Jobs.

2. concurrencyPolicy Forbid to avoid overlap.

3. timeZone field (1.27+).

4. History limits.

5. Monitor failures.

Operational verification

schedule → Job → pods

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Kubernetes declarative automation
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformKubernetes declarative automation · Automation implementations are tool and platform specific. Use the adjacent Domain for the technology being automated and this Domain for automation behavior.
Scope / prerequisiteUse this when running scheduled jobs in Kubernetes.
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

3 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

The negative fixture should deliberately exercise risks such as schema drift, selector overreach, admission rejection, controller lag, immutable fields, stale status and confusing created object with ready workload, choosing the cases most relevant to schedule expression, timeZone, concurrencyPolicy, startingDeadlineSeconds, suspend, Job creation and missed/overlapping runs.

Step 2 Example Narrow the fault
spec:
  schedule: "0 2 * * *"
  timeZone: "Europe/Copenhagen"
  concurrencyPolicy: Forbid
Step 3 Common mistakes Narrow the fault
  • Missing concurrencyPolicy, causing overlapping runs.
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • CronJobs create Jobs on a cron schedule.
  • concurrencyPolicy controls overlaps.
  • History limits keep old Jobs manageable.
Key checks
  • kubectl get cronjobs -n <ns> — cronjobs
  • kubectl create job --from=cronjob/<n> test-run — manual test run
  • concurrencyPolicy and startingDeadlineSeconds — behaviour
ReferenceWhy it matters1 section · depth on demand

In depth

A CronJob creates Jobs on a schedule using cron syntax — nightly backups, periodic compliance scans, certificate checks. It inherits all Job behaviour and adds scheduling controls.

apiVersion: batch/v1
kind: CronJob
metadata: { name: config-backup }
spec:
  schedule: "30 2 * * *"
  timeZone: "Europe/Copenhagen"
  concurrencyPolicy: Forbid
  startingDeadlineSeconds: 600
  successfulJobsHistoryLimit: 3
  failedJobsHistoryLimit: 5
  jobTemplate:
    spec:
      backoffLimit: 2
      template:
        spec:
          restartPolicy: OnFailure
          containers: [{ name: backup, image: registry.example.com/net-backup:3.0 }]

concurrencyPolicy: Forbid prevents overlapping runs. Trigger a test run manually with kubectl create job --from=cronjob/config-backup test-run.

ReferenceImportant terms & boundaries1 section · depth on demand
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docKubernetes declarative automation current

Authoritative/upstream documentation reviewed for bounded claims in Kubernetes Automation > CronJobs. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/ · confidence 94%
Depth when you need it

Deep reference

Healthy vs suspicious evidence

Output interpretation

For schedule expression, timeZone, concurrencyPolicy, startingDeadlineSeconds, suspend, Job creation and missed/overlapping runs, prefer typed fields and stable IDs over human presentation text.

Confirmation

Confirm action

Continue?