Run, shard, retry and schedule batch work

  • 14 min
  • 7 steps
  • Pods and workloads

Steps

0 of 7 done

Run a one-off Job, fan an Indexed Job out wider, watch backoffLimit stop a failing migration, and drive a CronJob by hand.

  1. Step 1 of 7

    Create a Job named hello that runs busybox:1.37, prints a greeting and exits. Wait until it reports Complete.

    Checked against the cluster as it changes.

  2. Step 2, not started: Read shard.yaml, an Indexed Job with six completions, and apply it. List its pods with a column for each pod's completion index.

  3. Step 3, not started: Two pods at a time is too slow. Let shard run three pods at once without deleting or recreating it, and wait for all six indexes to complete.

  4. Step 4, not started: Apply migrate.yaml. Its container exits with code 3 every time. Watch the pods until the Job stops creating new ones, and count how many it tried.

  5. Step 5, not started: Find the reason the Job controller gives for marking migrate failed.

  6. Step 6, not started: The nightly-report CronJob runs at 02:00 Berlin time. Run it once immediately, as a Job named report-now built from the CronJob's template, and wait for it to complete.

  7. Step 7, not started: Stop nightly-report from creating any more Jobs during a maintenance window, without deleting it.

Lab terminal

Cluster time 30 seconds
kind cluster kx, Kubernetes 1.37.
Each step is checked as you work.
​
Tab completes. Up and Down recall.
Type help for more.
Terminal keys

Enter runs the command. Tab completes, and the arrow keys recall earlier commands. Control C stops a watch. On an empty line, or after Escape, Tab moves focus out of the terminal.