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:

  1. Kubeadapt watches deployment events via admission webhook
  2. Calculates projected monthly cost
  3. Compares against firewall rules
  4. 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:

  1. Developer opens PR with Kubernetes changes
  2. Kubeadapt GitHub/GitLab bot analyzes YAML changes
  3. Bot comments on PR with cost breakdown
  4. 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:

  1. Navigate to Alerts & Routing tab
  2. Create Budget Alert: $5000/month
  3. Set warnings at 80%, 100%
  4. Configure Slack + Email notifications

Enable Cost Gates for Repository:

  1. Navigate to Cost Gates tab
  2. Connect GitHub repository
  3. Set threshold: $100/month increase
  4. Configure to block PR merge if exceeded

Block Expensive Staging Deployments:

  1. Navigate to Cost Firewall tab
  2. Create rule: Staging namespace, $200/month limit
  3. Action: Block deployment
  4. Test with expensive deployment