Skip to content

vBilling v0.2: durable ledger, Stripe and Metronome, every tenancy model - #1

Merged
saiyam1814 merged 4 commits into
mainfrom
feat/v0.2-ai-cloud-billing
Oct 5, 2026
Merged

saiyam1814 merged 4 commits into
mainfrom
feat/v0.2-ai-cloud-billing

Conversation

@saiyam1814

Copy link
Copy Markdown
Collaborator

Summary

vBilling v0.2 turns the v0.1 Lago exporter into a metering pipe for AI Clouds on vCluster:

  • Durable, hash-chained ledger. Every window commits atomically before any backend sees it; per-destination cursors, dead letters with replay, backfill after downtime, deterministic event IDs.
  • Destinations: Stripe Billing Meters (customers, one meter per metric and SKU, optional auto-subscribe), Metronome (with Stripe for payments), Lago, and a signed CloudEvents webhook.
  • Every tenancy model: shared nodes, dedicated nodes, and tenant clusters with their own nodes (vCluster Private Nodes, Auto Nodes, Standalone) read through a read-only kubeconfig vCluster exports. MIG, time-slicing, GKE partitions and DRA are billed at their physical fraction; deletions between windows are billed to the second; downtime is recorded, not billed.
  • Bring your own Prometheus: DCGM utilization (MIG included), PromQL-defined billable metrics, and a vCluster Platform fleet observability preset.
  • Reconciliation API, billing-state enforcement, ingest API, dashboard.
  • Docs: an end-to-end example on GKE (examples/gke-gpu, docs page example-gke.html), troubleshooting for private nodes and DCGM, quick starts that keep keys in Secrets.
  • Apache-2.0 license, CI, and a release workflow that publishes ghcr.io/vclusterlabs-experiments/vbilling for amd64 and arm64.

Validation

  • go vet ./..., go test -race ./... (15 packages), helm lint.
  • kind end to end (scripts/e2e-kind.sh): three tenant clusters, stripe-mock, webhook feed, Lago, enforcement loop.
  • GKE end to end: a time-sliced L4 shared-nodes tenant cluster and an A100 private node (NVIDIA GPU Operator, MIG all-1g.5gb) on vCluster 0.36.1, DCGM through Prometheus, a Stripe sandbox. Reconciliation of ledger vs Stripe: 12 series, 0 mismatches; a spot preemption billed only the seconds before the node became unreachable.
  • Fixed from that run: Stripe customer search unavailable in some regions, DCGM under MIG, GPUs installed but not allocatable after a reboot, DCGM's 30 s refresh vs short windows, secrets mounted with a trailing newline.

🤖 Generated with Claude Code

vBilling v0.2 core:
- Hash-chained ledger with atomic window commits, per-destination cursors,
  dead letters with replay, and ingest deduplication.
- Delivery to Stripe Billing Meters, Metronome, Lago and a signed
  CloudEvents webhook, with deterministic event IDs.
- Metering for shared nodes, dedicated nodes, and tenant clusters with
  their own nodes (vCluster Private Nodes, Auto Nodes, Standalone), read
  through a read-only tenant kubeconfig. MIG, time-slicing, GKE partitions
  and DRA; deletion watches; fair metering of downtime.
- Prometheus: DCGM utilization including MIG instances, PromQL-defined
  billable metrics, auth headers, and a vCluster Platform preset.
- Reconciliation, billing-state enforcement, ingest API and dashboard.

Fixes from a run on GKE with L4 and A100 GPUs and a Stripe sandbox:
- Find Stripe customers by listing them where search is unavailable.
- Count physical GPUs once under MIG and fall back to engine activity.
- Record GPUs that are installed but not allocatable as downtime.
- Add the {{window_seconds}} template and trim secrets read from files.
The chart runs vBilling as a StatefulSet with a ledger volume, a Service,
RBAC that only grows with the features enabled, the suspension admission
policy, a ServiceMonitor, and Secrets or existingSecret for every key.
The Lago demo now generates its RSA signing key at runtime.
examples/gke-gpu goes from an empty project to Stripe invoices: a
time-sliced L4 tenant cluster, an A100 joined as a private node with the
GPU Operator and MIG, DCGM through Prometheus, and vBilling in Stripe test
mode. The docs site gets the example page, troubleshooting for private
nodes and DCGM, and quick starts that keep keys in Secrets.
CI runs vet, race tests and a Helm lint on every pull request. Publishing
a release builds the linux/amd64 and linux/arm64 image the chart defaults
to and attaches the packaged chart.
@saiyam1814
saiyam1814 merged commit fa3f2ad into main Oct 5, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant