Skip to content

Latest commit

 

History

History
49 lines (35 loc) · 1.29 KB

K8s-CronJob.md

File metadata and controls

49 lines (35 loc) · 1.29 KB

LAB: K8s Cron Job

This scenario shows how K8s Cron job object works on minikube

Steps

apiVersion: batch/v1
kind: CronJob
metadata:
  name: hello
spec:
  schedule: "*/1 * * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: hello
            image: busybox
            imagePullPolicy: IfNotPresent
            command:
            - /bin/sh
            - -c
            - date; echo Hello from the Kubernetes cluster
          restartPolicy: OnFailure

image

  • Create Cron Job:

image

  • Watch pods' status:

image

  • Watch job's status:

image

  • Delete job:

image