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: kubernetesto 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: 25Gotchas
- 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
How to Choose Docker-in-Docker vs Mounting the SocketDecide between Docker-in-Docker and mounting the host Docker socket on self-hosted runners, weighing isolatio…
How to Deploy an ARC Runner Scale Set on KubernetesInstall Actions Runner Controller (ARC) and deploy a runner scale set on Kubernetes with Helm, wiring a liste…