Why Diverge?
Platform teams building ephemeral preview environments on Kubernetes inevitably hit a wall: how do you give every pull request and AI coding agent a realistic, isolated test environment without multiplying your cloud bill by the number of open PRs or shipping cluster metadata to a third-party SaaS?
Diverge was built from the ground up to solve this problem inside your own Kubernetes cluster.
The Ephemeral Environment Trilemma
Section titled “The Ephemeral Environment Trilemma”Engineering organizations typically evaluate three approaches to Kubernetes preview environments—each with a fundamental architectural flaw:
- 1. Full Namespace Clones (Argo CD PR Generator): Clones 100% of your microservices (
N services × M open PRs) for every pull request—even for a 2-line change in one service. Leads to astronomical cloud bills, cluster IP/etcd exhaustion, and 15+ minute cold spin-up times. - 2. Local Intercepts (Telepresence / mirrord): Tunnels traffic from a shared cluster to a developer's laptop. Great for interactive debugging, but dies the moment the laptop closes, cannot run unattended in CI pipelines, cannot share a persistent preview URL with PMs/designers, and cannot isolate autonomous AI agents.
- 3. SaaS Control Planes (Signadot / Okteto): Requires connecting your production/staging clusters to an external vendor control plane, introduces per-seat or per-sandbox commercial lock-in, and lacks native unification of database branching, OpenFeature flag isolation, and Macaroon-governed AI agent sandboxes.
- Delta Deployments Only: Deploys only the 1–2 services modified in a PR (
PreviewGroup) and routes all other upstream/downstream calls through your shared baseline via L7 HTTP/gRPC headers or Kafka/Temporal isolation. - Scale-to-Zero & Idle Hibernation: Idle PRs scale down to
0pods viaactivator-proxy, KEDA HTTP Add-on, Knative, or zero-dependencydivergedev.com/hibernate-afterannotations—waking in seconds with a browser-friendly splash screen. - Full-Stack & AI-Native Isolation: Combines isolated PostgreSQL schemas/branches + Atlas migrations, OpenFeature
flagd/Fliptflags, and gVisor/KataAgentTasksandboxes under a 100% self-hosted Apache 2.0 operator.
Architectural Footprint: Full Clone vs. Diverge Delta + Scale-to-Zero
Section titled “Architectural Footprint: Full Clone vs. Diverge Delta + Scale-to-Zero”flowchart LR
subgraph FullClone["Full Namespace Clone (Argo CD PR Generator)"]
direction TB
FC_Note["30 Open PRs x 25 Services = 750 Running Pods (24/7)"]
FC_PR1["PR #101 Namespace (25 Pods + Full DB)"]
FC_PR2["PR #102 Namespace (25 Pods + Full DB)"]
FC_PRN["PR #130 Namespace (25 Pods + Full DB)"]
end
subgraph DivergeArch["Diverge (Delta Deploy + Scale-to-Zero)"]
direction TB
DV_Base["Shared Baseline Namespace (25 Baseline Pods)"]
DV_Proxy["diverge-proxy & activator-proxy (Header / Cookie Routing)"]
DV_PR1["PR #101 Delta (2 Pods + PG Schema pr_101)"]
DV_PR2["PR #102 Hibernated (0 Pods until HTTP/gRPC request)"]
DV_Agent["AgentTask Sandbox (gVisor + Macaroon Budget)"]
DV_Proxy -->|"Baseline traffic"| DV_Base
DV_Proxy -->|"x-preview-env: pr-101"| DV_PR1
DV_Proxy -->|"202 Wake Splash -> Scale 0 to 1"| DV_PR2
DV_Agent -->|"Linked PreviewGroup"| DV_PR1
end
Head-to-Head Comparison Matrix
Section titled “Head-to-Head Comparison Matrix”| Capability | Diverge | Argo CD PR Generator (Full Clone) | Telepresence | Signadot | Okteto |
|---|---|---|---|---|---|
| 1. Deployment Footprint | Delta Deploy of changed services only (PreviewGroup + shared baseline fallback); also supports full-clone mode |
Clones 100% of services (N × M pods) per PR namespace |
Local workstation process intercepting 1 service; no cluster-hosted PR lifecycle | Route-based sandboxes (Sandbox CRD) sharing baseline |
Full namespace clone per developer/PR by default (or hybrid divert) |
| 2. Idle Resource Cost | Scale-to-Zero via activator-proxy (--wake-splash), KEDA HTTPScaledObject, Knative, or native divergedev.com/hibernate-after idle hibernation |
24/7 running pods for every open PR until PR merge/close | Runs on developer laptop CPU/RAM (dies when laptop sleeps) | Always-on sandbox pods while PR is open (TTL teardown, no built-in wake-splash activator) | Automated sleep/wake on commercial tiers; heavy full-stack footprint when awake |
| 3. Database Isolation | 6-mode Database Provider (schema per PR with auto-provisioned DATABASE_URL & DIVERGE_PREVIEW_SCHEMA, neon, cnpg, cockroach, snapshot, shared) + native Ariga Atlas migrations |
Heavy full DB container per PR (slow, unseeded) or manual custom scripting | Manual local DB or shared staging DB (high risk of developer schema collisions) | Custom resource plugins (DIY scripts for schema/branch provisioning) | Volume snapshots or full DB container clones per namespace |
| 4. Async Message Queue Isolation | Native Kafka & Temporal (AsyncProvisioner for isolated topics, consumer groups, and Temporal task queues) + Webhook provider |
Requires duplicating Kafka/Temporal clusters per PR or manual topic prefixing | Primarily HTTP/gRPC L7 intercept; queues require manual consumer filtering | Requires application-level SDK header inspection & custom consumer routing | Full broker clone per namespace or manual topic isolation |
| 5. Feature Flag Isolation | Native OpenFeature integration (flagd per-PR ConfigMap overrides & ephemeral Flipt namespaces auto-cleaned on PR merge) |
Manual ConfigMap duplication or shared global feature flags |
None built-in (shares cluster or local env flags) | None built-in (requires external flag provider routing rules) | None built-in |
| 6. Autonomous AI Agent Sandboxes | First-class AgentTask CRDs with gVisor / Kata isolation, attenuated Macaroon capability tokens, linked previews, MCP server, & live /api/v1/agenttask/meter budget enforcement |
None | None | None (focused on human/CI service sandboxes) | None (general dev containers without K8s-native Macaroon or LLM budget governance) |
| 7. Shareable Browser Previews | One-click ?_diverge_env=pr-42 URL cookie switcher + optional floating preview switcher banner + auto-refreshing wake-up splash page — no browser extension required |
Dedicated DNS hostname per PR (requires wildcard DNS + TLS per PR) | Requires commercial cloud login / browser extension and developer laptop online | Browser extension or SaaS proxy URLs | Subdomain URLs managed by Okteto proxy |
| 8. Control Plane & Licensing | 100% self-hosted Kubernetes operator + embedded React Web Dashboard & ConnectRPC API. Apache 2.0 Open Source | Self-hosted Kubernetes operator (Apache 2.0), but requires custom glue for DBs, routing, & cleanup | OSS client/traffic-manager + commercial control plane for team features | Proprietary SaaS control plane with in-cluster agent (commercial) | Proprietary SaaS / Enterprise self-hosted license |
Interactive Preview Cost & Savings Calculator
Section titled “Interactive Preview Cost & Savings Calculator”How much cloud compute does Delta Deployment + Scale-to-Zero save compared to cloning a full namespace per PR?
Use the interactive calculator below. It uses the exact default rate card built into Diverge’s Prometheus cost estimator (diverge_environment_estimated_hourly_cost_usd in internal/metrics/cost.go): $0.04 per vCPU-hour and $0.004 per GiB-hour, with the default per-service footprint of 0.25 vCPU + 0.5 GiB RAM ($0.012 / pod-hour or $8.76 / pod-month across a 730-hour month).
Preview Environment Cloud Cost & Savings
0.25 vCPU + 0.5 GiB = $0.012/pod-hr
<div class="diverge-slider-group"> <div class="diverge-slider-label"> <label for="calc-prs">Average Concurrent Open PRs</label> <output id="out-prs" for="calc-prs">30 PRs</output> </div> <input type="range" id="calc-prs" min="5" max="200" step="1" value="30" /> <div class="diverge-slider-ticks"><span>5</span><span>100</span><span>200</span></div> </div>
<div class="diverge-slider-group"> <div class="diverge-slider-label"> <label for="calc-modified">Average Services Modified per PR (Delta)</label> <output id="out-modified" for="calc-modified">2 services</output> </div> <input type="range" id="calc-modified" min="1" max="10" step="1" value="2" /> <div class="diverge-slider-ticks"><span>1</span><span>5</span><span>10</span></div> </div>
<div class="diverge-slider-group"> <div class="diverge-slider-label"> <label for="calc-hours">Active Testing Hours per PR / Day (Scale-to-Zero)</label> <output id="out-hours" for="calc-hours">4 hrs / day</output> </div> <input type="range" id="calc-hours" min="1" max="24" step="1" value="4" /> <div class="diverge-slider-ticks"><span>1h (96% idle)</span><span>12h</span><span>24h (always-on)</span></div> </div></div>
<div class="diverge-calc-results"> <div class="diverge-result-row diverge-result-clone"> <div class="diverge-result-meta"> <span class="diverge-result-name">Full Namespace Clone (Argo CD PR Gen)</span> <span class="diverge-result-sub" id="res-clone-pods">750 always-on preview pods</span> </div> <div class="diverge-result-price" id="res-clone-cost">$6,570<span>/mo</span></div> </div>
<div class="diverge-result-row diverge-result-delta"> <div class="diverge-result-meta"> <span class="diverge-result-name">Diverge Delta Deploy (Always-On)</span> <span class="diverge-result-sub" id="res-delta-pods">60 delta pods (shared baseline)</span> </div> <div class="diverge-result-price" id="res-delta-cost">$526<span>/mo</span></div> </div>
<div class="diverge-result-row diverge-result-s2z"> <div class="diverge-result-meta"> <span class="diverge-result-name">Diverge Delta + Scale-to-Zero</span> <span class="diverge-result-sub" id="res-s2z-pods">10.0 active pod-equivalents (hibernated 20h/day)</span> </div> <div class="diverge-result-price diverge-price-accent" id="res-s2z-cost">$88<span>/mo</span></div> </div>
<div class="diverge-savings-banner"> <div class="diverge-savings-main"> <div> <div class="diverge-savings-label">Net Monthly Cloud Savings</div> <div class="diverge-savings-value" id="res-monthly-savings">$6,482/mo</div> </div> <div class="diverge-savings-pct" id="res-savings-pct">98.7% Saved</div> </div> <div class="diverge-savings-annual"> Projected Annual Compute Savings: <strong id="res-annual-savings">$77,789 / year</strong> </div> </div></div>How the Cost Formulas Work
Section titled “How the Cost Formulas Work”Diverge’s controller exposes a built-in Prometheus gauge (diverge_environment_estimated_hourly_cost_usd in internal/metrics/cost.go) using DefaultCostRates():
- vCPU Hourly Rate:
$0.04 / vCPU-hr(DefaultCostRates().HourlyVCPUUSD) - Memory Hourly Rate:
$0.004 / GiB-hr(DefaultCostRates().HourlyMemoryGiBUSD) - Default Service Footprint (
0.25 vCPU + 0.5 GiB):hourlyRate = (0.25 * $0.04) + (0.5 * $0.004) = $0.012 / hr ($8.76 / month)
For a team with 25 baseline microservices, 30 concurrent open PRs, an average of 2 modified services per PR, and 4 active testing hours per day (730 hours/month):
- Full Namespace Clone Monthly Cost:
services * openPRs * 730h * hourlyRate= 25 * 30 * 730 * $0.012 = $6,570.00 / month (750 pods)
- Diverge Delta Deploy Monthly Cost:
modifiedServices * openPRs * 730h * hourlyRate= 2 * 30 * 730 * $0.012 = $525.60 / month (60 pods — 92.0% reduction)
- Diverge Delta + Scale-to-Zero Monthly Cost:
modifiedServices * openPRs * (activeHours / 24) * 730h * hourlyRate= 2 * 30 * (4 / 24) * 730 * $0.012 = $87.60 / month (10 active pod-equivalents — 98.7% reduction)
When to Choose Diverge
Section titled “When to Choose Diverge”Choose Diverge when your team needs:
- Zero-trust, 100% self-hosted control: Everything runs as standard Kubernetes CRDs (
PreviewGroup,Environment,AgentTask) inside your cluster under the Apache 2.0 license. - Full-stack isolation beyond HTTP: Native PostgreSQL schema/branch provisioning with Ariga Atlas migrations, Kafka & Temporal async isolation, and OpenFeature (
flagd/Flipt) flag isolation. - Frictionless reviewer & PM experience: One-click
?_diverge_env=pr-42cookie routing and a202 Acceptedcold-start wake-up splash screen—no browser extensions or local CLI tunnels required for reviewers. - Autonomous AI coding agent sandboxes: First-class gVisor/Kata
AgentTasksandboxes with cryptographic Macaroon capability tokens, automatic linked preview environments, and real-time LLM budget enforcement.
