Apache APISIX Route Health & Upstream Drift Sentinel
Audit Apache APISIX gateway health, detect canary route drift or disabled upstreams, and dispatch Slack alerts.
Check the CronJobs in a namespace on a schedule and ping Slack when one misses its run or fails. Skips suspended jobs and never repeats an alert.
Kubernetes CronJobs fail silently. A backup job that never ran or a cleanup job that kept failing can go unnoticed for days because nothing pages when a schedule is missed. This blueprint watches the CronJobs in a namespace every day and pings Slack when one misses its run or fails, and stays quiet when everything is healthy.
list_cronjobs (io.kestra.plugin.scripts.shell.Commands) runs kubectl get cronjobs in the namespace through a bitnami/kubectl container and saves the JSON.list_jobs (io.kestra.plugin.scripts.shell.Commands) runs kubectl get jobs the same way, so the flow can see which runs failed.find_trouble (io.kestra.plugin.scripts.python.Script) reads the single JSON list of CronJobs we already alerted on from the KV store (empty on the first run), then goes through every CronJob and checks two things. Missed: the last schedule time is older than twice the expected interval, or it never ran at all. Failed: any Job owned by the CronJob failed. Suspended CronJobs are skipped because pausing one is a choice, not a problem. Anything already alerted on is dropped.maybe_alert (io.kestra.plugin.core.flow.If) runs only when there is something new to report, and send_alert posts the troubled CronJobs to Slack with the reason and a kubectl command to inspect each one.save_state (io.kestra.plugin.core.kv.Set) writes back the new list of troubled names. Recovered names drop out on their own, so a future failure alerts again.Kubernetes will retry a failed Job and eventually give up, but it never tells anyone the schedule itself is broken. Kestra keeps the whole check in one visible flow: the schedule, the kubectl reads, the missed and failed detection, the duplicate-alert guard, and the Slack call are all one auditable execution history. The KV-backed memory means the alert logic survives restarts without an external database.
CLIENT_CRT: client certificate for the Kubernetes API.CLIENT_KEY: client key for the Kubernetes API.MASTERURL: Kubernetes API server URL.SLACK_WEBHOOK: Slack incoming webhook for the alerts. In Kestra OSS, secrets are supplied as environment variables prefixed SECRET_, base64-encoded, and read back with {{ secret('NAME') }}, for example SECRET_SLACK_WEBHOOK=$(echo -n 'https://hooks.slack.com/services/<placeholder>' | base64).CLIENT_CRT, CLIENT_KEY and MASTERURL secrets, and the webhook as SLACK_WEBHOOK (base64-encoded, see above).default.namespace input.label_selector input and pass -l to the kubectl commands to watch a subset.2 * interval factor in the Python step.namespace: the namespace whose CronJobs to watch (defaults to default).slack_webhook: Incoming webhook URL of the Slack channel for the alerts.successfulJobsHistoryLimit is very low, old successes age out of the check.