Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
iconfalse

https://dev-k8sref-io.web.app/docs/workloads/cronjob-v1beta1/

Info
iconfalse
  • apiVersion: batch/v1beta1
  • kind: CronJob

  • metadata (ObjectMeta)
  • spec (CronJobSpec)
    • schedule                      #실행 스케줄 설정 Linux Crontab정책과 동일
    • concurrencyPolicy   #동시 실행 가능
    • jobTemplate
  • status (CronJobStatus)


Code Block
titlecronjob.yaml
linenumberstrue
apiVersion: batch/v1
kind: CronJob
metadata:
  name: hello-cronjob
spec:
  schedule: "*/1 * * * *" # 매분마다 실행
  concurrencyPolicy: Allow # 동시 실행 가능
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: hello
            image: busybox:1.28
            imagePullPolicy: IfNotPresent
            command:
            - /bin/sh
            - -c
            - date; echo Hello from the Kubernetes cluster
          restartPolicy: OnFailure


...