Skip to content
StackDecode
IntermediateLesson 17 of 35

Jobs, CronJobs and DaemonSets

Run-to-completion work, scheduled work, and one pod per node.

yaml
apiVersion: batch/v1
kind: CronJob
metadata: { name: nightly-train }
spec:
  schedule: '0 2 * * *'
  jobTemplate:
    spec:
      backoffLimit: 2
      template:
        spec:
          restartPolicy: Never
          containers:
            - name: train
              image: myorg/train:1.0
  • Job: runs pods until a number succeed (training run, migration).
  • CronJob: creates Jobs on a schedule.
  • DaemonSet: one pod on every (or selected) node: log shippers, monitoring agents, GPU device plugins.