Home

CronJob

CronJob is a Kubernetes resource that runs Jobs on a repeating schedule. It uses a cron-like schedule to trigger the creation of Job objects at specified times.

The CronJob consists of a schedule and a jobTemplate that defines the Job to be created. When

Other important fields include startingDeadlineSeconds, which allows skipping late schedules, and suspend, which can pause scheduling.

Scheduling details: The schedule uses Cron syntax with five fields (minute, hour, day of month, month, day

Use cases and considerations: common tasks include periodic data processing, backups, report generation, and cleanup. To

the
schedule
time
arrives,
the
CronJob
controller
creates
a
Kubernetes
Job
resource
from
the
template
and
starts
the
pods.
The
controller
enforces
the
concurrencyPolicy,
which
can
be
Allow,
Forbid,
or
Replace.
In
newer
versions,
CronJob
supports
timeZone
to
specify
the
time
zone
for
the
schedule.
The
CronJob
controller
can
retain
a
limited
number
of
completed
or
failed
Jobs
via
successfulJobHistoryLimit
and
failedJobHistoryLimit.
of
week).
Jobs
created
by
a
CronJob
run
to
completion,
launching
pods
that
perform
the
work.
Each
Job
follows
the
standard
Job
lifecycle
and
is
independent
of
other
Jobs
unless
constrained
by
concurrencyPolicy.
ensure
reliability,
write
idempotent
containers,
set
resource
requests
and
limits,
monitor
Job
status,
and
configure
history
limits
to
control
resource
use.