Skip to content
Latchkey

How to Run a Fresh Container or Pod Per Job

A fresh container or pod per job gives clean isolation, which pairs naturally with ephemeral autoscaling.

On Kubernetes, ARC can run each job in its own pod, and with containerMode: kubernetes each job step even spawns workload pods. Combined with ephemeral runners, every job starts from a known-clean image, so scaling up never reuses a tainted environment.

Steps

  • Use ARC so each runner is its own ephemeral pod.
  • Set containerMode.type: kubernetes to run job containers as separate pods.
  • Provide a workflow-scoped PVC for scratch space that is discarded after the job.

values.yaml

values.yaml
containerMode:
  type: kubernetes
  kubernetesModeWorkVolumeClaim:
    accessModes: ["ReadWriteOnce"]
    storageClassName: standard
    resources:
      requests:
        storage: 10Gi
minRunners: 0
maxRunners: 25

Gotchas

  • Kubernetes container mode needs a work volume claim, or job containers cannot share the workspace.
  • Per-pod isolation adds scheduling overhead; keep images small to limit cold-start.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →