Amith M
11/06/2025, 4:38 PMMarvin
11/06/2025, 4:38 PMMarvin
11/06/2025, 4:44 PMspec.ttlSecondsAfterFinished (or set a large value) so Jobs aren’t deleted immediately
- Optionally set spec.backoffLimit: 0 to avoid retries and keep the first failed pod intact
- Example base job template snippet:
apiVersion: batch/v1
kind: Job
spec:
backoffLimit: 0
# omit ttlSecondsAfterFinished to avoid auto-cleanup, or set a large value
template:
spec:
restartPolicy: Never
containers:
- name: prefect-job
# image/command/env are injected by the worker
- Configure this in Cloud: Work Pools -> your Kubernetes pool -> Base job template.
- Docs: Kubernetes worker guide and Managing work pools
- Docker worker: you can configure the base container settings to avoid auto-removal so failed containers stick around for inspection. If you’re on Docker, I can share an exact template.
Regardless of compute, you can pull full logs for a failed run:
prefect flow-run logs <flow-run-id>
CLI ref: prefect flow-run logs
Can you confirm which compute you’re using for Job Run v2 — Prefect Serverless, a Kubernetes worker, or Docker? I’ll tailor the exact settings/template for your setup.Jake Kaplan
11/06/2025, 4:47 PMAmith M
11/06/2025, 5:59 PMJake Kaplan
11/06/2025, 7:08 PMAmith M
11/07/2025, 7:12 PM