Kubernetes Lab 8 - Cron Jobs
Solution
apiVersion: batch/v1
kind: CronJob
metadata:
name: xwing-cronjob
spec:
schedule: "*/2 * * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: xwing-status
image: ibmcase/xwing-status:1.0
args:
- /usr/sbin/xwing-status.sh
restartPolicy: OnFailure
Note: The CronJob API was moved from
batch/v1beta1tobatch/v1in Kubernetes 1.21. Usebatch/v1for clusters running Kubernetes 1.21 or later.