CronJob

Is a type of Job that can be schedule as in Linux CronTab. The following snippet creates a CronJob to sum 3 + 2 schedule for every minute.

apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: math-add-cron-job
spec:
  schedule: "*/1 * * * *"  # every minute
  jobTemplate:
    spec:
      template:
        spec:
          containers:
            - name: math-add
              image: ubuntu
              commad: ["expr", "3", "+", "2"]
              
          restartPolicy: Never
Links to this page
  • Job

    Not much to explain here. A transient pod executes a task in the cluster until the task is finished or completed. Is possible to schedule a job using CronJob.

#kubernetes