CronJobs in Kubernetes

A CronJob is a Job that can be scheduled: just like crontab in Linux.

Example:

apiVersion: batch/v1
kind: CronJob
metadata:
  name: math-cron-job
spec:
  schedule: "*/1 * * * *"
  jobTemplate:
    spec:
      completions: 3
      parallelism: 3
      template:
        spec:
          containers:
          - name: math-add
            image: ubuntu
            command: [ "expr", "3", "+", "5" ]
	  restartPolicy: Never