Prerequisites
- Kubernetes cluster (1.26+)
kubectlconfiguredhelm(optional, for Helm installation)
Step 1: Install CronJob Guardian
Install using Helm
The fastest way to install CronJob Guardian is with Helm:This installs the operator with default settings:
- SQLite storage with 1Gi persistent volume
- Dashboard enabled on port 8080
- Prometheus metrics enabled
Step 2: Set Up Alerts (Optional)
Skip this step if you just want to use the dashboard. You can configure alerts later.
Create a Slack webhook secret
First, create a Slack incoming webhook for your workspace, then create a secret:
Step 3: Create a Monitor
Now let’s create a monitor to watch CronJobs in your cluster.- Monitor One Namespace
- Monitor Cluster-Wide
- Monitor by Labels
Monitor all CronJobs in a specific namespace:Apply it:
monitor-namespace.yaml
Step 4: Access the Dashboard
The dashboard provides a visual interface for viewing metrics and execution history.Open in your browser
Navigate to http://localhost:8080You’ll see:
- List of all monitored CronJobs
- Success rates and execution counts
- Recent execution history
- Duration charts and heatmaps
For production use, configure an Ingress or LoadBalancer. See Installation for details.
Step 5: Test It Out
Let’s create a test CronJob to see Guardian in action.Check the dashboard
Refresh the dashboard at http://localhost:8080 and you’ll see:
- The new CronJob appears in the list
- Execution history shows the successful run
- Duration metrics start populating
What You’ve Accomplished
- Installed CronJob Guardian operator
- Configured Slack alerts (optional)
- Created monitors for your CronJobs
- Accessed the dashboard
- Tested with a sample CronJob
What Happens Next?
CronJob Guardian is now:- Watching all CronJobs matching your monitor selectors
- Recording execution history and calculating metrics
- Alerting when jobs fail or don’t run on schedule
- Tracking SLA compliance and performance trends
Trigger a Test Alert
Want to see how alerts work? Create a CronJob that fails:failing-job.yaml
- Failure reason
- Pod logs
- Kubernetes events
- Link to dashboard
Next Steps
Installation Guide
Learn about all installation options and configuration
Configure Monitors
Deep dive into monitor configuration and selectors
Set Up SLA Tracking
Configure success rates and duration thresholds
More Examples
See real-world configuration examples
Getting Help
If you run into issues:- Check the Troubleshooting Guide
- View operator logs:
kubectl logs -n cronjob-guardian deployment/cronjob-guardian - Open an issue on GitHub