Container Cost Attribution in Multi-Tenant Clusters
Multi-tenant clusters save money on infrastructure and lose visibility on per-team spend. Tooling closes the gap.
Why multi-tenant hides cost
Multi-tenant clusters save infrastructure cost by sharing capacity. The trade-off is that per-team spend disappears into a single cluster bill.
- One line item. The cluster bill is monolithic; cloud-native cost reports cannot split it.
- Per-team math. Allocation is computed, not measured; the computation is opinionated.
- Without the math. No team owns their fraction; the cluster cost is everybody's-and-nobody's.
- Forcing function. Without attribution, teams have no incentive to optimise their footprint.
Four attribution patterns
- 1. Kubecost (commercial; broad adoption).
- 2. OpenCost (CNCF open-source; same data).
- 3. Custom metrics (DIY).
- 4. Label-based attribution (manual).
Tool comparison
Three options cover the space. Kubecost and OpenCost share the same core engine; custom is for organisations with unusual requirements.
- Kubecost. Easiest to deploy; commercial; pay for advanced features and support.
- OpenCost. Same core engine, CNCF-hosted, free; you operate the dashboards yourself.
- Custom. Fits unique needs (multi-cloud, tenant-aware billing); engineering cost is real.
- Label-based. Manual attribution via Kubernetes labels; the floor of the discipline; no real tooling.
Negotiating the math
The math is opinionated. Idle capacity, networking, storage attribution all involve judgement calls; document the model so teams accept it.
- Idle attribution. Who pays for the slack capacity in the cluster: largest tenant, proportionally, or platform team?
- Networking. Pod-to-pod traffic is hard to attribute; either approximate or document the simplification.
- Storage attribution. Per-PV-claim is straightforward; shared storage (object stores) is messier.
- Documented model. Teams accept the math when they understand it; the doc is the source of truth.
Antipatterns
- No attribution. Spend grows uncontrolled.
- Attribution without team buy-in. Argued every quarter.
- Switching tools quarterly. Math discontinuous.
What to do this week
Three moves. (1) Apply this lever to your highest-spend workload. (2) Measure the dollar impact for one month. (3) Roll the practice out to the next two services if the savings hold.