To build Kubernetes chargeback, install OpenCost or Kubecost, connect your cloud billing so allocation uses real rates, define allocation by namespace and label so every pod rolls up to an owner, reconcile the total against the invoice, then distribute per team cost monthly. OpenCost is the free CNCF allocation engine; Kubecost adds the hosted UI, multi cluster, and reporting on top. The decision that makes or breaks credibility is how you treat idle and shared cost, so settle that before the first charge goes out.
Last updated: June 2026. Written by Fredrik Filipsson and reviewed by Morten Andersen, built on our See, Cut, Lock, Run method.
This article sits in our complete guide to Kubernetes cost optimization, the cluster pillar it links up to, and connects to the broader cloud cost optimization playbook. For the allocation model that sits underneath chargeback, see our companion explainer on what Kubernetes cost allocation with OpenCost is. Chargeback is a Lock step practice: it keeps the savings in place by giving every dollar an owner.
How you handle idle and shared cost. A cluster always carries unused reserved capacity and overhead the control plane and system pods that does not belong to any one team. If you bury it, the numbers will not reconcile and teams will reject them. Decide up front whether idle and shared cost is spread proportionally, held in a central platform budget, or surfaced separately so the platform team owns packing efficiency. That single choice is what makes chargeback credible.
What is Kubernetes chargeback?
Kubernetes chargeback is the practice of attributing a shared cluster's cost to the teams that consumed it and billing it to their budgets. It depends on cost allocation, the calculation that maps each pod's CPU, memory, storage, and network use to a price and rolls it up by namespace, label, or team. Chargeback is the step beyond showback: showback reports the cost to build awareness, chargeback moves the money to create accountability. Kubecost and OpenCost are the tools that do the allocation math that chargeback then bills against.
How do I set up chargeback, step by step?
Set it up by choosing a tool, installing it, wiring real rates, allocating by owner, reconciling, then distributing. Six steps:
- Choose Kubecost or OpenCost. Pick OpenCost for a free CNCF allocation engine, or Kubecost for the hosted UI, multi cluster, and reporting built on it. Result: an allocation engine matched to your scale.
- Install with Helm. Deploy the chart into a dedicated namespace and confirm it scrapes Prometheus metrics for CPU, memory, storage, and network. Result: per pod resource data flowing.
- Set the cloud rate card. Connect the cloud billing integration so allocation uses your negotiated, Spot, and committed rates, not list prices. Result: allocation that matches the invoice.
- Allocate by namespace and label. Define allocation by namespace, label, or team so every pod cost rolls up to an owner, including shared and idle cost. Result: a per team cost breakdown.
- Validate against the bill. Reconcile the allocated total against the cloud invoice. Result: finance trusts the numbers before any charge goes out.
- Distribute chargeback. Export per team allocation monthly and apply your idle and shared cost rule. Result: a recurring charge teams accept.
Should I use Kubecost or OpenCost?
Use OpenCost when you want a free, open source allocation engine and can build your own reporting; use Kubecost when you want the hosted UI, multi cluster aggregation, longer retention, alerts, and savings recommendations on top. OpenCost is the CNCF project that does the core allocation math, and Kubecost is the commercial product built on the same model. A single cluster team running showback is well served by OpenCost. A platform group running chargeback across many clusters, with finance asking for dashboards and history, usually wants Kubecost. Both produce the same underlying per workload numbers.
Want chargeback that finance and engineering both trust?
Our Kubernetes engagement stands up Kubecost or OpenCost, reconciles allocation to your invoice, and sets the idle and shared cost policy so the numbers hold. On the performance model, you pay only from realized savings. No savings, no fee.
Book a Kubernetes cost audit →How do I make the numbers reconcile?
Make the numbers reconcile by allocating against real cloud rates and accounting for every dollar, including idle and shared cost. Connect the billing integration so allocation uses negotiated, Spot, and committed prices instead of on-demand list prices, then compare the allocated total to the invoice for the same period. The two should land within a small margin. When they do not, the gap is almost always unallocated idle capacity, untagged workloads, or list price estimation, each of which you can fix. Reconciliation is what turns an interesting dashboard into a number teams will pay against.
The Kubernetes Cost Optimization Handbook includes the chargeback policy template and the idle and shared cost decision matrix referenced above. It is the downloadable companion to this walkthrough.
Frequently asked questions
What is the difference between Kubecost and OpenCost?
OpenCost is the open source, CNCF hosted allocation engine that calculates Kubernetes cost by workload; Kubecost is the commercial product built on OpenCost that adds a hosted UI, multi cluster aggregation, longer retention, alerts, and savings recommendations. OpenCost is free and covers core allocation; Kubecost layers reporting and enterprise features on the same model.
What is the difference between showback and chargeback?
Showback reports each team its Kubernetes cost without moving money, to build awareness. Chargeback actually bills that cost to the team's budget, creating accountability. Most organizations start with showback for a quarter to validate the numbers, then move to chargeback once teams trust the allocation.
How do you handle idle and shared Kubernetes cost in chargeback?
Idle cost is unused reserved capacity and shared cost is cluster overhead like the control plane and system pods. You either distribute them proportionally across teams, charge them to a central platform budget, or surface idle separately so the platform team is accountable for packing efficiency. Deciding this up front is what makes chargeback credible.
Does Kubecost use my actual cloud rates?
Yes, once you connect the cloud billing integration. Kubecost and OpenCost can reconcile allocation against your real negotiated, Spot, and committed use rates rather than public list prices, which is essential for chargeback numbers that match the invoice. Without the integration they estimate from on-demand list prices.
The short version
Install OpenCost or Kubecost, wire in real cloud rates, allocate by namespace and label, reconcile to the invoice, then distribute per team cost with a clear idle and shared cost rule. When you want chargeback stood up and trusted across teams, that is what our rightsizing and waste elimination service delivers.
Cloud pricing and service behavior change frequently. Verify the specifics in this guide against the providers’ own current documentation and the FinOps Foundation: FinOps Foundation Framework ↗, FinOps Invoicing & Chargeback capability ↗ and FOCUS billing specification ↗. This article also reflects Cloud Cost Room’s hands-on, vendor-neutral engagement experience.