Versions Compared

Key

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

...

Code Block
apiVersion: batch/v1beta1
kind: CronJob
metadata:
  name: daily
spec:
  schedule: "1 0 * * *"
  jobTemplate:
    spec:
      template:
        spec:
          containers:
          - name: daily
            image: talele08/api-cronjob-image-24
            command: ["python3","cronJobAPIConfig.py"]
            args: ["daily"]  
            env:
              - name: JOB_NAME
                valueFrom:
                  fieldRef:
                    fieldPath: metadata.name
          restartPolicy: OnFailure             

The cron job timing can be adjusted using the schedule property. The above value schedule: "1 0 * * *" will trigger the cron job everyday at 00:01 AM.

...