Cost Prevention
ALPHA FEATURE - Cost Prevention is currently in active development.
What it is: Proactive cost control system that prevents expensive deployments before they reach production through real-time gates, alerts, and firewall rules.
Overview
Cost Prevention shifts from reactive optimization to proactive control via three components:
1. Cost Firewall - Block deployments exceeding cost thresholds 2. Cost Gates (ALPHA) - GitOps integration for PR-based cost analysis 3. Alerts & Routing - Notifications when costs spike or thresholds breach
Philosophy: "Prevent expensive mistakes before they cost you money."
Access: Select cluster (Clusters page or sidebar dropdown) → Cost Prevention
1. Cost Firewall
What it does: Real-time cost enforcement that blocks or warns about deployments exceeding defined thresholds.
How it works:
- Kubeadapt watches deployment events via admission webhook
- Calculates projected monthly cost
- Compares against firewall rules
- Blocks or warns based on policy
Example Rules:
- Production: Block workloads >$500/month
- Staging: Warn for workloads >$200/month
- Namespace Budget: Block if namespace total >$2000/month
- GPU Workloads: Block if >$1000/month per workload
Override Management:
- Request overrides with justification
- Admin approval workflow
- Temporary or permanent overrides
2. Cost Gates (ALPHA)
What it does: GitOps-integrated cost analysis that comments on Pull Requests with cost impact before merge.
How it works:
- Developer opens PR with Kubernetes changes
- Kubeadapt GitHub/GitLab bot analyzes YAML changes
- Bot comments on PR with cost breakdown
- Team reviews cost before merging
Gate Policies:
- Block PR if cost increase >$100/month
- Warn only (allow merge with comment)
- Per-workload and total PR thresholds
- Percentage increase limits
GitHub Integration:
- Automatic PR comments
- Status check integration
- @mention teams on high costs
3. Alerts & Routing
What it does: Proactive notifications when costs spike, budgets breach, or anomalies detected.
Alert Types:
- Budget Alerts - Threshold-based notifications (80%, 100%, 120%)
- Spike Alerts - Unusual cost increases (+30% in 1 hour)
- Anomaly Alerts - AI-detected abnormal patterns
- Forecast Alerts - Projected budget overruns
Notification Channels:
- Slack (with actionable buttons)
- Email (detailed reports)
Throttling:
- Configurable rate limits (e.g., max 1 alert per hour)
- Prevents alert fatigue
Common Workflows
Set Up Production Budget Alert:
- Navigate to Alerts & Routing tab
- Create Budget Alert: $5000/month
- Set warnings at 80%, 100%
- Configure Slack + Email notifications
Enable Cost Gates for Repository:
- Navigate to Cost Gates tab
- Connect GitHub repository
- Set threshold: $100/month increase
- Configure to block PR merge if exceeded
Block Expensive Staging Deployments:
- Navigate to Cost Firewall tab
- Create rule: Staging namespace, $200/month limit
- Action: Block deployment
- Test with expensive deployment