Link Search Menu Expand Document

CronJob

simple.yaml

---
# https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/
apiVersion: batch/v1
kind: CronJob
metadata:
  name: cronjob-simple
spec:
  schedule: "* * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - command:
                - /bin/sh
                - -c
                - date; echo Hello from the Kubernetes cluster cronjob
              image: busybox:1.28
              imagePullPolicy: IfNotPresent
              name: cronjob-simple-container
          restartPolicy: OnFailure