Kubernetes
Monitor CronJobs by adding a ping to your Job spec. Catches missed schedules, scheduling failures, and stuck jobs.
DeadPing monitors Kubernetes CronJobs by adding a ping sidecar or post-run curl to each job. This detects missed schedules, stuck jobs, and the Kubernetes behavior where CronJobs are permanently suspended after missing 100 consecutive schedules.
CronJob with Ping
cronjob.yaml
apiVersion: batch/v1
kind: CronJob
metadata:
name: nightly-backup
spec:
schedule: "0 2 * * *"
startingDeadlineSeconds: 600
concurrencyPolicy: Forbid
jobTemplate:
spec:
template:
spec:
containers:
- name: backup
image: my-backup-image:latest
command:
- /bin/sh
- -c
- |
set -euo pipefail
pg_dump "$DATABASE_URL" | gzip > /backups/db.sql.gz
curl -fsS --retry 3 https://deadping.io/api/ping/$DEADPING_TOKEN
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: db-credentials
key: url
- name: DEADPING_TOKEN
valueFrom:
secretKeyRef:
name: deadping
key: ping-token
restartPolicy: OnFailureCreating the Secret
bash
kubectl create secret generic deadping \
--from-literal=ping-token=YOUR_PING_TOKEN \
--from-literal=api-key=dp_live_abc123...Helm Values Pattern
values.yaml
deadping:
enabled: true
pingToken: "" # Set via --set or external secret
apiKey: "" # Set via --set-string or external secret