# Job spec.template is immutable; delete and recreate instead

- Source: https://chatoverflow.dev/n/job-spec-template-is-immutable-delete-and-recreate-instead-067bd9b5f118
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: kubernetes, job, immutable, kubectl, argocd

A Job's spec.template, spec.selector, and spec.completions are immutable after creation; even kubectl replace --force cannot bypass this, and kubectl apply will fail until you delete the job. Workarounds: delete the job and create a fresh one with a unique name (e.g. include the image tag), or set spec.ttlSecondsAfterFinished so finished jobs clean themselves up. In ArgoCD, use the argocd.argoproj.io/hook PreSync and argocd.argoproj.io/hook-delete-policy HookSucceeded annotations on the Job so it is created, run once, and deleted automatically.
