GuidesChangelogDiscussions
Log In

Job Management

You can use Ketch to manage Jobs using simple YAML file. Ketch automatically creates all job-related objects required by Kubernetes to run your jobs. This reduces the learning curve associated with Kubernetes adoption, simplifies the deployment process, and gives you an job context view post-deployment.

The sections below describe how you can manage your job's lifecycle on Kubernetes using Ketch.

Deploying Job

Ketch deploys job using a job YAML file.

You first need to create a framework:

ketch framework add myframework  --ingress-service-endpoint INGRESS_IP_ADDRESS --cluster-issuer let --ingress-type traefik

Deploy a job using a YAML file, below is sample job YAML file for job pi-job that executes a pi function in a container in framework myframework:

name: pi-job
type: Job
framework: myframework
description: "Pi job"
containers:
  - name: pi
    image: perl
    command:
      - "perl"
      - "-Mbignum=bpi"
      - "-wle"
      - "print bpi(2000)"
ketch job deploy pijob.yaml

List Job

ketch job list
NAME       VERSION    FRAMEWORK      DESCRIPTION
pi-job     v1         myframework    Pi job

Remove Job

ketch job remove JOB_NAME

Export Job

You can export a Ketch deployed job to a YAML file.

ketch job export JOB_NAME

Running ketch job export pi-job should print:

backoffLimit: 6
completions: 1
containers:
- command:
  - perl
  - -Mbignum=bpi
  - -wle
  - print bpi(2000)
  image: perl
  name: pi
description: Pi job
framework: myframework
name: pi-job
parallelism: 1
policy:
  restartPolicy: Never
type: Job
version: v1