Cost allocation across shared cloud infrastructure
This is an illustrative scenario describing how we typically approach this kind of engagement. It does not describe a specific client, and no results are claimed.
Challenge
A typical scenario: the cloud bill grows, but shared clusters and accounts make it impossible to tell which team or product drives the cost.
Architecture
- Tagging and labeling standard enforced through Terraform and policy
- Billing exports into a queryable store
- OpenCost for Kubernetes cost allocation
- Per-team cost reports and anomaly alerts
Approach
- Define the allocation model: team, service, environment
- Enforce tags on new resources and backfill existing ones
- Allocate shared cluster cost by usage
- Introduce regular cost reviews with team owners
Technology
OpenCost · Terraform · Cloud billing exports
Implementation
- Add tag policies to infrastructure modules
- Build cost dashboards per team and service
- Identify idle and oversized resources
- Set budgets and anomaly alerts
Intended outcome
The intended result is a bill that each team can see and own, which is the foundation for any lasting optimization.
Lessons learned
- Visibility comes before optimization
- Shared-cost allocation rules should be simple and agreed
- Make cost a regular engineering review topic