Skip to content

cronjobspec

Feature state: 1.0.0

cronjobspec value in Kubedeploy defines CronJob specific parameters.

Note

cronjobspec will be only taken into account if the deploymetMode is set to Cronjob.

Available values for cronjobspec in Kubedeploy:

cronjobspec:
  schedule: "0 * * * *" # (1)
  restartPolicy: OnFailure # (2)
  command: [] # (3)
  args: [] # (4)
  backoffLimit: 3 # (5)
  startingDeadlineSeconds: 180 # (6)
  successfulJobsHistoryLimit: 3 # (7)
  failedJobsHistoryLimit: 1 # (8)
  concurrencyPolicy: "" # (9)
  1. Define cronjob schedule, for details see reference
  2. Define restart policy for cronjob if deploymentMode=Cronjob.
  3. Define command for cronjob
  4. Define args for cronjob
  5. Define job backoff limit, see reference
  6. (optional) Define deadline for starting the job, see reference
  7. Define number of successful Job logs to keep
  8. Define number of failed Job logs to keep
  9. Define concurrency policy options: Allow (default), Forbid or Replace, see reference

Deprecation Warning

Starting from Kubedeploy version 1.2, you should begin using image.command and image.args instead of cronjobspec.command and cronjobspec.args. These values will remain available as failsafe options until Kubedeploy 2.0, at which point they will be removed.

Define cronjob

values.yaml
1
2
3
4
5
6
7
8
9
nameOverride: my-cronjob
deploymentMode: Cronjob
image:
  repository: busybox
  tag: latest

cronjobspec:
  schedule: "*/10 * * * *"
  command: ["sh", "-c", "echo hello from cronjob" ]
Deploy command
helm install hello sysbee/kubedeploy -f values.yaml

The above example will create a CronJob that will run every 10 minutes and echo a hello message.

See also: