Docs · Integrations
Kubernetes CronJobs
A small read-only controller that gives each annotated CronJob a check and reports every Job.
Published at launch: the
pingding-k8simage and a manifest that applies unedited.
Annotate a CronJob and the controller does the rest: it makes a check with the same schedule and time zone, sends /start when each Job starts, and success or /fail with Kubernetes' reason when it ends.
apiVersion: batch/v1
kind: CronJob
metadata:
name: nightly-backup
namespace: batch
annotations:
pingding.dev/monitor: "true"
pingding.dev/grace: "15m" # optional
spec:
schedule: "0 3 * * *"
timeZone: Europe/Berlin
Install
Make a team API token with the member role.
Store it, and name the cluster:
kubectl create namespace pingding-system kubectl -n pingding-system create secret generic pingding-api-token --from-file=token=./token kubectl -n pingding-system create configmap pingding-k8s --from-literal=cluster-name=prodApply the release manifest (its address is published at launch).
The controller runs as one replica with a read-only role: it can only list and watch CronJobs and Jobs. It never changes anything in your cluster.
Annotations
| Annotation | What it does |
|---|---|
pingding.dev/monitor |
"true" opts the CronJob in; "false" opts it out. |
pingding.dev/grace |
The check's grace, such as "90s", "15m", "2h". |
The checks
- One check per CronJob, named
<namespace>/<cronjob> · <cluster>. - Its schedule follows the CronJob's, including
timeZone. - Suspending the CronJob pauses the check; deleting it pauses the check too, so its history is kept.
- Manual Jobs (
kubectl create job --from=cronjob/…) count as runs. - After a restart, the controller reports Jobs that finished while it was away.