Kubespec Logo kubespec.dev

batch/v1

Namespaced Resource

CronJob

        CronJob represents the configuration of a single cron job.
      

Click on Property Name to show the description, and Pink Types to expand schema.

Required properties are marked with *

Change History

Kubernetes v1.32

+2~82

Kubernetes v1.31

+7-1~41

Kubernetes v1.30

+9~19

Kubernetes v1.29

+16-1~8

Kubernetes v1.28

+6~25

Kubernetes v1.27

+3~22

Kubernetes v1.26

+7~5

Kubernetes v1.25

+5-4~7

Kubernetes v1.24

+2~119

Kubernetes v1.23

+10~75

Kubernetes v1.22

+9~31

Kubernetes v1.21

Kubernetes v1.20

Kubernetes v1.19

Kubernetes v1.18

Kubernetes v1.17

Kubernetes v1.16

Kubernetes v1.15

Kubernetes v1.14

Kubernetes v1.13

Kubernetes v1.12

Kubernetes v1.11

Examples

There are 2 examples of CronJob that you can use as a starting point to create your own.

apiVersion: batch/v1
kind: CronJob
metadata:
  name: hello-kube
  namespace: checkout # CronJob is a namespaced resource
spec:
  schedule: '0 0 * * *' # run every day at midnight
  jobTemplate:
    spec:
      template:
        metadata:
          name: hello-kube-job
        spec:
          containers:
            - name: hello-kube
              image: busybox
              command: ['echo', 'Hello from Kubernetes CronJob']

Other useful resources