cronjob就是定时任务
schedule就是类似与crontab -e编辑定时任务分时日月周
apiversion kind metadata sepc {schedule job template{ spec {remplate spec (conotainers: name image command)}}}
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: cronjob-demo
labels:
jobgroup: cronjob-demo
spec:
schedule: "*/5 * * * *"
jobTemplate:
spec:
backoffLimit: 3
completions: 1
parallelism: 1
template:
spec:
containers:
- name: cronjob-demo
image: busybox:latest
command:
- /bin/bash
- -c
- "for i in `seq` 1 100; do echo ${i} && sleep 1 done"
restartPolicy: Never