alert: KubeJobFailed
expr: kube_job_status_failed > 0
for: 1m
severity: warning
Alert message: Job {{ $labels.namespace }}/{{ $labels.job_name }} failed
A Job has Pods that finished with an error (kube_job_status_failed > 0). The task has not completed or is running with retries. For a CronJob the metric remains for as long as the Job object exists (limited by failedJobsHistoryLimit).
An error in the task script, an unavailable database/API, insufficient permissions, a timeout (activeDeadlineSeconds), a shortage of resources.
kubectl -n <ns> get jobs
kubectl -n <ns> describe job <name>
kubectl -n <ns> get pods -l job-name=<name>
kubectl -n <ns> logs -l job-name=<name> --tail=100
Fix the cause using the logs, then delete the failed Job (kubectl -n <ns> delete job <name>) so the alert clears, or wait for the next successful CronJob run and the history cleanup.
If the failure is known, understood and no rerun is needed (but then delete the Job).
The full pack of 44 tested rules + Alertmanager → Telegram: 790 ₽ (≈ $9, card payment in rubles)
Open in Telegram · Free Monitoring Lite kit · All runbook alerts