Job Properties

In Kubernetes, a job is a resource type used to run pods (one or more instances of a container) to completion. It is primarily designed for short-lived, batch workloads, such as running a containerized task once or a finite number of times.

Job Properties describes the job properties:

Table 1. Job Properties
Name Description
job.enabled Set this to true to enable jobs in the application's Helm chart. The default value is false.
job.containers The job container.
job.containers.image The image for the job container.
job.containers.volumeMounts The mount path for volumes.
job.containers.command A command for the job container.
job.containers.args Arguments to be passed to the job container.
job.containers.env Environment variables to be passed to the job container.
job.rbac The role-based access control parameters for the job container.
job.additionalPodAnnotations More pod annotations added in a pod created by this job.
job.backoffLimit The number of retries before considering the job as having failed.
job.restartPolicy Defines how the job container restarts upon exiting.
job.containers.resources Application pod resource requests and limits for the job container, for example:

resources:
  limits:
    memory: 256Mi
    cpu: 0.5
  requests:
    memory: 128Mi
    cpu: 0.1
This is an example of a job properties configuration:
job:
  enabled: true
  imagePullSecrets: "registry-creds"
  volumes:
    pv-volume:
      persistentVolumeClaim:
        claimName: task-pv-volume
  name: start-job
  annotations:
    helm.sh/hook: pre-delete
    helm.sh/hook-delete-policy: before-hook-creation,hook-succeeded
  additionalPodAnnotations:
    kubectl.kubernetes.io/default-container: busybox-chf
    kubectl.kubernetes.io/default-logs-container: busybox-chf
  containers:
    image:
      name: busybox
      repository: localhost:32000/busybox
      tag: "1.0"
      pullPolicy: Always
    env:
      TZ:
        value: UTC
    command: ['perl']
    args: [ '--no-colors' ]
    volumeMounts:
      pv-volume:
        mountPath: /tmp
    resources:
      limits:
        cpu: 4
      requests:
        cpu: 250m
  restartPolicy: OnFailure
  backoffLimit: 4