Apptio Cloudability study materials
Apptio Cloudability study resources

Kubernetes Cost Allocation Chaos

Apptio Cloudability · Put your knowledge to work in context.

All case studies

Kubernetes Cost Allocation Chaos

A SaaS company runs 50 Kubernetes clusters across AWS and GCP, managed by 8 engineering teams. Monthly Kubernetes spend is $250,000, but cost allocation is a mess: 40% of costs are unallocated due to shared namespaces, idle resources, and missing labels. The CFO demands accurate showback by team and product by next quarter. The platform team uses a mix of EKS and GKE, with some clusters running on committed instances. The FinOps team has Cloudability but struggles with container cost visibility. They propose implementing a strict labeling policy, but teams resist due to overhead. Additionally, the company uses a shared services model where some clusters host multiple teams' workloads. The FinOps team needs a pragmatic approach to achieve 90% allocation accuracy within 3 months without causing team revolt.

1. Design a cost allocation model for Kubernetes that balances accuracy and team overhead. What specific steps would you take in the first 30, 60, and 90 days?

Read the worked answer

30 days: Foundation

  • Implement automated labeling using Kubernetes admission controllers (e.g., OPA Gatekeeper) to enforce mandatory labels (team, product, environment) at deployment time. This reduces manual overhead.
  • Use Cloudability's Kubernetes cost allocation features (e.g., container cost allocation) to map costs to namespaces and labels. For unlabeled resources, apply a default 'unallocated' tag.
  • Identify idle resources (e.g., via Kubecost or Cloudability) and start a cleanup campaign.

60 days: Shared cost distribution

  • For shared clusters, allocate costs proportionally based on resource requests (CPU/memory) per team. Implement a showback report using Cloudability's business mapping.
  • Establish a 'shared services' cost pool for common components (e.g., monitoring, ingress) and distribute based on a fair metric (e.g., headcount or revenue).
  • Run a pilot with two teams to refine the model.

90 days: Automation and accountability

  • Automate the allocation process with scheduled reports and dashboards.
  • Set up alerts for unallocated costs exceeding 10%.
  • Conduct training and establish a FinOps guild with team representatives to ensure ongoing compliance.

This approach achieves 90% allocation by combining automation, clear rules, and gradual rollout.

2. How would you handle the 40% unallocated costs, specifically those from idle resources and shared namespaces?

Read the worked answer

Unallocated costs stem from:

  • Idle resources: Identify via rightsizing recommendations. Implement a policy to automatically scale down non-production clusters during off-hours. For production, set up alerts for low utilization. Allocate idle costs to the team that owns the namespace/cluster, as a penalty to encourage efficiency.
  • Shared namespaces: If a namespace hosts multiple teams, use label-based splitting (e.g., by pod labels). If labels are missing, use a default allocation based on historical usage or headcount. Document the method and get stakeholder buy-in.
  • Untagged resources: Apply a 'unknown' tag and assign to the platform team for follow-up. Set a KPI to reduce untagged resources by 50% in 60 days.

Use Cloudability's cost allocation rules to distribute shared costs. For example, allocate cluster-level costs (e.g., control plane) based on each team's share of worker node costs. Transparently communicate the methodology to avoid disputes.