batch/v1 · Namespaced Resource
CronJob
CronJob represents the configuration of a single cron job.
Click on Property Name to see the description, and Pink Types to expand schema.
Looking for some 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 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']
apiVersion: batch/v1
kind: CronJob
metadata:
name: complex-cron-job
namespace: checkout # CronJob is namespaced resource
spec:
schedule: '*/15 * * * 1-5' # run every 15 minutes on weekdays (Mon-Fri)
jobTemplate:
spec:
template:
metadata:
name: multi-container-job
spec:
containers:
- name: container-1
image: busybox
command: ['echo', 'This is container 1']
- name: container-2
image: busybox
command: ['echo', 'This is container 2']
restartPolicy: OnFailure
concurrencyPolicy: Forbid
successfulJobsHistoryLimit: 5
No links for CronJob yet
You can help us by adding useful links on GitHub