Architecture Note · AI & Edge Infrastructure

Deterministic Cloud FinOps & Kubernetes/GPU Cost Optimization: P95 Rightsizing, Unit Economics, and Human-Gated Cleanup

Why prompt-driven cloud cost bots break Kubernetes reliability and Finance trust—and how FOCUS normalization, deterministic P95 GPU sizing, and mandatory human approval gates keep multi-cloud spend auditable.

The Operational Problem: Idle GPU Fleets and Unattributed Multi-Cloud Spend

Platform and AI infrastructure teams operating across AWS EKS, GCP GKE, and Azure AKS routinely over-provision pod CPU, memory, and NVIDIA H100 or A100 GPU requests to avoid production incidents. Static sizing spreadsheets leave inference routers and distributed training workers holding multi-GPU reservations at 26% to 48% streaming-multiprocessor occupancy. Meanwhile, shared cluster control planes, cross-AZ NAT gateway traffic, and object storage egress disappear into unallocated overhead, while detached block volumes, stale 90-day snapshots, and zero-traffic load balancers quietly compound monthly burn.

Why Naive AI Wrappers Fail in Production FinOps

Handing raw billing exports and cluster telemetry to a generic LLM wrapper breaks along four operational fault lines:

  • Nondeterministic sizing and commitment math: Language models approximate percentages inconsistently. When a model miscalculates P95 memory headroom, break-even months on 3-year Reserved Instances, or per-tenant egress splits, Finance cannot reconcile outputs against AWS CUR or GCP BigQuery rows.
  • Uncontrolled telemetry egress: Uploading raw billing tables, customer account IDs, and internal cluster topologies to external model endpoints creates unnecessary third-party exposure for sensitive cost and tenant-margin data.
  • Unsafe autonomous execution: Letting an agent auto-patch Kubernetes manifests or purge unattached storage without owner verification risks OOMKills during traffic bursts, multi-year lock-in on shifting workloads, or deleting disaster-recovery snapshots.
  • Schema drift and missing auditability: Provider-specific exports diverge across AWS, GCP, and Azure. Without canonical normalization and tamper-evident decision logs, engineering teams cannot defend chargeback rates or cleanup approvals.

The Deterministic Architecture That Fixes It

A reliable FinOps control plane keeps all calculation, normalization, and gating deterministic inside a local FastAPI and SQLite (WAL mode) boundary, reserving optional summarization for an offline deterministic adapter.

  1. Canonical FOCUS ingestion with 1-hour upload auto-wipe: POST /api/finops/ingest accepts aws_cur, gcp_billing, k8s_utilization, and focus payloads, normalizing line items into canonical FOCUS columns (BillingAccountId, ChargeCategory, ProviderName, RegionId, ResourceId, EffectiveCost, BilledCost). Ephemeral uploads use 0600 permissions and auto-wipe after 3,600 seconds while retaining SHA-256 batch metadata behind scoped invite tokens and sliding-window rate limits.
  2. P95 headroom rightsizing and fractional MIG detection: POST /api/finops/rightsize calculates safe pod requests from 30-day P95 usage plus a configurable buffer (default 20%, adjustable 10% to 35% in the sandbox) with a 1.15x memory limit margin. Single-GPU workloads (H100, A100, L40S) whose effective buffered demand falls at or below 0.52 trigger fractional MIG 3g.40gb recommendations and YAML diffs requiring Platform Owner name and ticket sign-off before staging.
  3. Cross-cloud RI, Savings Plan, and Spot modeling: Deterministic discount matrices evaluate 1-year (28% to 38%) and 3-year (46% to 57%) commitments across AWS Savings Plans, GCP CUDs, and Azure RIs alongside 68% Spot fallback on interruptible training pools, computing upfront outlay and break-even month under a mandatory Finance sign-off gate.
  4. Unit-cost attribution and OWASP-safe FOCUS export: GET /api/finops/unit-cost distributes shared cluster, NAT gateway, and S3/GCS/Blob egress via proportional compute, network/request-weighted, or 60/40 hybrid models to report cost_per_tenant and cost_per_api_request, while simulating VPC gateway endpoints (-48% NAT) and CDN origin shields (-55% egress). GET /api/finops/exports/focus.csv prefixes formula triggers (=, +, -, @) to prevent spreadsheet injection.
  5. Human-gated cleanup and immutable audit chain: POST /api/finops/cleanup/{id}/approve enforces explicit owner_confirmed, approver name, and ticket attestation—returning HTTP 409 if unconfirmed or already actioned—and appends every decision to a SHA-256 hash-chained SQLite audit_logs table protected by BEFORE UPDATE and BEFORE DELETE abort triggers.

Operational Takeaway

Multi-cloud GPU and Kubernetes cost control requires repeatable arithmetic, not conversational guesswork. When billing feeds normalize into FOCUS tables, P95 sizing and Spot mixes follow explicit formulas, and every patch, commitment, and deletion passes a recorded human gate, platform and finance teams cut waste without risking uptime.

Test deterministic FinOps controls on your own billing & cluster telemetry

Start with a free 30-minute workflow check. Bring one FOCUS CSV, AWS CUR / GCP billing export, or OpenCost namespace report and leave with one concrete recommendation in writing within one business day.