Kubernetes Cronjob Scheduling Guide
Schedule Cronjobs in Kubernetes
Tasks
Steps
apiVersion: batch/v1 kind: CronJob metadata: name: xfusion spec: schedule: "*/7 * * * *" jobTemplate: spec: template: spec: restartPolicy: OnFailure containers: - name: cron-xfusion image: httpd:latest command: ["echo", "Welcome to xfusioncorp!"]cat <<EOF > cronjob.yaml apiVersion: batch/v1 kind: CronJob metadata: name: xfusion spec: schedule: "*/7 * * * *" jobTemplate: spec: template: spec: restartPolicy: OnFailure containers: - name: cron-xfusion image: httpd:latest command: ["echo", "Welcome to xfusioncorp!"] EOF
k apply -f cronjob.yaml
k get cronjob -o wide
k describe cronjob
