Kubernetes cost allocation with OpenCost is the practice of assigning the real cloud cost of a shared cluster to the namespaces, deployments, and labels that consume it, using OpenCost's open source allocation engine. OpenCost measures each pod's CPU, memory, GPU, storage, and network use, prices it at the node's actual rate, and rolls it up to whatever dimension you group by. It is the CNCF-hosted, vendor-neutral specification behind Kubecost's allocation, free to run in your own cluster, and it turns one opaque invoice into per-team accountability, which is the first step toward cutting the bill.
Last updated: June 2026. Written by Fredrik Filipsson and reviewed by Morten Andersen, built on our See, Cut, Lock, Run method.
This explainer 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. Allocation is the foundation for billing teams back, which we cover in our companion guide on how to build Kubernetes chargeback with Kubecost or OpenCost. Allocation is a See step capability: it is how you give every dollar an owner.
You cannot cut what you cannot see by team. A shared cluster arrives as one line on the cloud bill, so platform teams get blamed for spend they do not control and product teams have no signal to optimize. OpenCost assigns that spend back to the namespace and workload that caused it, including the idle headroom each team reserved. Once cost has an owner, right-sizing and consolidation have someone accountable for them, which is what actually moves the bill.
What is OpenCost?
OpenCost is an open source, CNCF-hosted project that measures and allocates the real cloud cost of Kubernetes workloads. Per the OpenCost documentation, it reads pod resource consumption from the cluster, multiplies it by live pricing for the cloud you run on, and attributes the cost to namespaces, controllers, labels, and other dimensions. It began as the open specification underlying Kubecost and is now an independent CNCF incubating project, which is why it is the de facto standard for vendor-neutral Kubernetes cost measurement. You run it inside your own cluster, so the data never leaves your environment.
How does OpenCost allocate cost to a workload?
OpenCost allocates cost by measuring each pod's resource use over time, pricing it at the node's actual rate, and summing the result up the dimension you choose. For compute it uses the greater of a pod's request or its usage, so capacity that a workload reserved but left idle is still charged to that workload, which is the honest accounting that drives right-sizing. It prices CPU, memory, GPU, persistent volumes, load balancers, and network egress, then lets you group by namespace, deployment, pod, label, or annotation. Shared costs such as the control plane and idle nodes can be spread proportionally or shown separately as overhead, so teams see both their direct cost and their share of the commons.
What is the difference between OpenCost and Kubecost?
OpenCost is the free allocation engine and specification; Kubecost is a commercial product built on it that adds a richer interface, longer data retention, multi-cluster aggregation, alerting, and governance features. They share the same core allocation model, so the numbers agree, which makes OpenCost a low-risk starting point: adopt it, learn your cost shape, and move to Kubecost only when you need enterprise scale. Many teams run OpenCost in each cluster and aggregate elsewhere rather than paying for the managed tier. The full build-out, including showback and chargeback, is in our guide on how to build Kubernetes chargeback with Kubecost or OpenCost.
Want every team to own its share of the Kubernetes bill?
Our Kubernetes cost audit stands up allocation with OpenCost, maps spend to your namespaces and labels, and turns the data into the right-sizing and consolidation actions that lower it. On the performance model, you pay only from realized savings. No savings, no fee.
Book a Kubernetes cost audit →What do you do with the allocation data?
Allocation data turns into savings when you use it to right-size requests, drive accountability, and target the most expensive workloads first. The teams with the largest gap between requested and used capacity are the fastest wins, because lowering their requests improves packing and lets the autoscaler run fewer nodes. Allocation also makes showback and chargeback possible, which changes behavior: when a team sees its monthly number, it tends to clean up idle environments and oversized requests on its own. Feed the data into the levers in our bin packing efficiency explainer to connect per-team cost to cluster-wide waste.
The Kubernetes Cost Optimization Handbook includes the OpenCost allocation setup checklist and the showback and chargeback templates referenced above. It is the downloadable companion to this explainer.
Frequently asked questions
What is OpenCost?
OpenCost is an open source, CNCF-hosted project that measures and allocates the real cloud cost of Kubernetes workloads. It reads pod resource usage from the cluster and multiplies it by live provider pricing to attribute cost to namespaces, deployments, labels, and other dimensions. It is the vendor-neutral specification and reference implementation behind Kubecost's allocation engine, so the two share the same core model.
How does OpenCost allocate cost to a namespace?
OpenCost allocates cost by measuring each pod's CPU, memory, GPU, persistent volume, and network usage over time, pricing those resources at the node's actual rate, and summing the result up to the namespace, controller, or label you group by. It uses the greater of a pod's request or usage for compute, so reserved-but-idle capacity is attributed to the workload that reserved it. Shared and idle cluster costs can be distributed proportionally or left visible as overhead.
What is the difference between OpenCost and Kubecost?
OpenCost is the open source allocation engine and specification; Kubecost is a commercial product built on top of it that adds a richer UI, longer retention, multi-cluster aggregation, alerts, and enterprise features. OpenCost gives you accurate allocation data and a basic API and UI for free; Kubecost packages that data into a managed product. Many teams start on OpenCost and move to Kubecost when they need scale and governance features.
Is OpenCost free?
Yes. OpenCost is free and open source under the Apache 2.0 license and is a CNCF incubating project. You run it in your own cluster, so your only cost is the compute it consumes, which is small. Pricing data for the major clouds is built in, and you can supply custom rates for on-prem or negotiated pricing.
The short version
OpenCost allocates the real cost of a shared Kubernetes cluster to namespaces, workloads, and labels using live pricing, giving every dollar an owner and making chargeback possible. It is free, vendor-neutral, and the engine behind Kubecost, so it is the natural place to start. When you want allocation stood up and turned into actual savings on your cluster, 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 Allocation capability ↗ and FOCUS billing specification ↗. This article also reflects Cloud Cost Room’s hands-on, vendor-neutral engagement experience.