Interview Prep/Kubernetes/Resources, OOM, probes and termination

A Job shows `BackoffLimitExceeded` and no Pods are left to inspect.

BeginnerTroubleshootingResources, OOM, probes and termination
Answer

Likely causes → Containers failed backoffLimit + 1 times (default 6 retries). With restartPolicy: Never failed Pods are kept unless ttlSecondsAfterFinished or cleanup removed them; with OnFailure the same Pod restarts and is deleted when the Job fails.

Diagnose →

kubectl describe job db-backup | sed -n '/Events/,$p'
kubectl get pods -l job-name=db-backup
kubectl logs -l job-name=db-backup --tail=50

Fix → Use restartPolicy: Never while debugging so failed Pods stay; read their logs; fix the script. Re-run with kubectl create job db-backup-manual --from=cronjob/db-backup.

Prevent → Ship Job logs to central logging, and alert on kube_job_status_failed.

All Kubernetes questions Roadmap: Kubernetes core

More on Resources, OOM, probes and termination