How do you alert on Kubernetes Jobs and CronJobs failing?
IntermediateScenarioGrafana, Dashboards and Kubernetes Monitoring
Answer
Situation read → Failed jobs leave no running pods to observe.
What I'd do →
- Alert on failed jobs:
kube_job_status_failed > 0. - Alert on CronJobs not succeeding recently:
time() - max by (namespace, cronjob) (kube_cronjob_status_last_successful_time) > 2 * 3600
- Set
successfulJobsHistoryLimitandfailedJobsHistoryLimitto keep evidence. - Ship job logs before pods are cleaned up.
Why → "Last successful time" catches both failures and jobs that never ran.
Interview tip → Mention concurrencyPolicy and suspended CronJobs as hidden causes.
More on Grafana, Dashboards and Kubernetes Monitoring
Grafana has 900 dashboards and nobody can find anything. How do you clean it up?IntermediateHow do you manage Grafana dashboards as code?IntermediateDesign a service overview dashboard that an on-call engineer can read in 10 seconds.BeginnerYou need to show deploy events on every Grafana graph. How?BeginnerPods are being OOMKilled but the memory graph never reaches the limit. Why?IntermediateHow do you detect CPU throttling hurting latency in Kubernetes?Intermediate