Why teams need Kubernetes cost allocation with OpenCost
OpenCost is an open-source tool that assigns the cost of a Kubernetes cluster to namespaces, workloads and labels so that teams can see what they consume. It reads resource requests and usage from Prometheus, applies unit prices to CPU, memory, storage and load balancer resources, and exposes the results through an API and a UI. It is a CNCF project. On a shared self-managed cluster, that data answers the question finance and platform leads usually cannot answer today: which team is driving the spend on a set of nodes that nobody has assigned to a team.
The pricing step is where self-managed clusters differ from cloud-hosted ones. On a public cloud, OpenCost can pull list prices from the provider. On hardware you own, in a data center or a private cloud, there is no bill to read, so the cost figures are only as good as the rates you configure for CPU, memory, storage and network, along with the node costs you choose to assign. Those rates are a finance decision as much as a technical one. Before rollout, agree with finance who sets the rates, how often they are reviewed, and whether amortized hardware, power and licensing are included. Confirm the exact configuration keys for on-premises pricing in the OpenCost documentation for your release.
This page covers showback, meaning cost reports that inform teams and budget owners, not chargeback, meaning invoices or internal transfers that move money between cost centers. Showback is the usual first step because it exposes waste and unplanned growth without changing how budgets are approved. Chargeback needs agreed rates, reconciliation with the general ledger and a process for disputes, and it should follow a period of accurate showback. The sections that follow cover the Prometheus requirements, the pricing configuration and the reports and capacity planning uses.
How cost data flows from nodes to showback reports
Cost data starts with workloads and nodes exposing resource metrics, which Prometheus scrapes and stores. OpenCost reads those series from Prometheus and applies the on-premises pricing configuration you supply to turn usage into cost per namespace, workload or team. The results reach the OpenCost UI, its API and a showback report for finance and team leads. Check that the Prometheus datastore sits inside your cluster boundary, that the pricing file matches your real hardware and that every series OpenCost depends on is actually being scraped.
Data path from cluster metrics through OpenCost to showback reports.
Pricing and deployment options and when each fits
This table compares the three ways OpenCost can price resources and the two ways it can get metrics, with the input each needs and who owns the rates. Read the pricing rows to decide where your cost numbers come from, and the Prometheus rows to decide how much retention and scrape resolution you can afford to share with monitoring.
| Option | Input needed | What it reflects | Who owns the rates |
|---|---|---|---|
| Default cloud-style pricing | No pricing file; OpenCost falls back to its built-in default rates | Generic list-style rates that may not match your hardware or amortized costs | OpenCost project defaults; treat as a starting point, not a chargeback basis |
| Custom on-premises pricing | A pricing configuration file with CPU, RAM, GPU and storage rates you set | Your own hardware, power, licensing and facility costs as you define them | Your finance or infrastructure team, who must agree and update the figures |
| Cloud-provider pricing | Cloud account billing access and cluster credentials for the provider's price data | Actual provider list or negotiated rates for nodes and volumes in that account | The cloud provider, with your finance team reviewing discounts and credits |
| Dedicated Prometheus for OpenCost | A separate Prometheus instance with its own storage and scrape settings | Cost metrics with retention and scrape interval tuned only for cost queries | Your platform team owns sizing; cost is extra compute and storage |
| Reuse of an existing kube-prometheus-stack | Access to the existing Prometheus and its retention and scrape configuration | Shared metrics; cost queries depend on the same scrape interval and retention | Your monitoring team; changes to retention can break historical cost reports |
Setting up OpenCost on a self-managed cluster
This sequence takes a self-managed cluster from confirmed metrics inputs to OpenCost allocation data that finance and platform teams can check against node capacity and use for showback. Each step ends with a check so problems surface before reports go out.
Confirm Prometheus scrapes the cost inputs
The platform engineer confirms that the Prometheus instance OpenCost will read is scraping kubelet, cAdvisor and kube-state-metrics on every node and namespace it needs to cost. Container CPU and memory usage come from cAdvisor metrics exposed through the kubelet, and resource requests and node capacity come from kube-state-metrics, so gaps here become gaps in allocation. Check the target list in the Prometheus UI and run queries for container CPU usage and kube-state-metrics pod requests across a sample of namespaces. The step is done when every node appears as a healthy target and both query types return series for every node.
Agree the on-premises rate card with finance
Before any configuration, the platform team and finance agree on the unit prices OpenCost will apply to CPU, RAM, GPU, persistent storage and network, because a self-managed cluster has no cloud bill to read from. Finance should state the basis for each rate, such as the amortized hardware cost, power, cooling, licensing and data center space, and say whether the rate covers one-time purchase or recurring operating cost. The platform team records which node pools and storage classes each rate applies to. The output is a signed-off rate card with a named owner and a review date, and the step is done when every resource type in the cluster has a rate or an explicit decision to exclude it.
Install OpenCost in its own namespace
The platform engineer installs OpenCost into a dedicated namespace and points it at the Prometheus endpoint confirmed in the first step. Using a dedicated namespace keeps its service account, RBAC and resource limits separate from workloads being costed. Where the cluster already runs a shared Prometheus for alerting, the team decides whether OpenCost reads that instance or a separate one, and records the reason, since heavy query load from cost reports can affect alerting. The check is that the OpenCost pod starts, its health endpoint responds, and its log shows a successful connection to Prometheus without repeated query errors.
Configure custom pricing for on-premises rates
The platform engineer loads the agreed rate card into OpenCost as custom pricing, so that cost calculations use on-premises figures instead of public cloud list prices. The configuration needs one entry per resource type and, where node pools differ, per node class, and the team should check the configuration keys against the OpenCost version they installed. Changes to rates should be made through version-controlled configuration so finance can trace which rate applied to a given month. The check is that the OpenCost cost API reports a non-zero hourly cost for a sample node and that the figure matches the arithmetic from the rate card for that node's CPU, memory and storage capacity.
Verify allocation totals against node capacity
The platform engineer compares the total allocated cost across all namespaces and the unallocated remainder with the total cost of the nodes in the rate card. Allocated cost should account for the cluster's full node cost, and the unallocated share should be small and explainable, such as idle capacity or system namespaces. The team checks several namespaces by hand against their pod requests and usage to confirm that the attribution logic behaves as expected. Any difference that cannot be explained by idle capacity or excluded resources goes back to the rate card or the Prometheus data. The step is done when reconciliation differences are documented and accepted by finance and the platform owner.
Set up RBAC for the UI and API
The platform team creates separate roles for people who view cost data and for systems that read it, and binds them to the OpenCost UI and API. Read access should be limited to the namespaces or teams each reader is allowed to see, and the cluster administrator decides whether finance users receive cluster-wide read access. Kubernetes authentication should come from the identity provider the organization already uses, not local accounts created for the cost tool. The check is that a test user in one team can see only that team's namespaces, a second user with cluster-wide access can see all of them, and an unauthorized request to the API is refused and logged.
Schedule showback exports
The platform engineer configures a recurring export of allocation data, typically one summary per team or cost center per period, and sends it to the finance team in a format they can load into their reporting tools. The export should carry the rate card version so each month's figures can be reproduced later. The team agrees with finance who receives the report, what happens when a namespace has no owner, and how disputes are raised and resolved before the first chargeback decision. The check is that a scheduled export runs and produces a file whose totals reconcile with the allocation report from the verification step.
Showback reports for finance, platform and team leads
Finance needs monthly totals that map to cost centers, not per-pod detail. The report should roll allocated cost up by a cost center label or namespace-to-cost-center mapping that the finance team owns, and show the month, the cluster and the total for each. Its purpose is to answer where the platform spend is going and whether it moved from the previous month.
- Monthly totals by cost center: One row per cost center per month, built from a mapping table agreed with finance.
- Cluster and environment split: Production, staging and shared clusters shown separately so shared platform costs are visible.
- Month-over-month movement: The change per cost center, with a note on any new namespaces or workloads that explain it.
- Unallocated share: The portion of spend not attributed to any cost center, reported as its own line.
- Assumptions block: The node prices, storage rates and any discount or amortization used, named with their owner.
Before this report goes to finance, confirm with the rate card owner which prices were entered and whether they match the invoice or a negotiated rate. Showback is informational. It is not a chargeback statement and does not replace the cloud or hardware invoice.
Platform engineers need the grain that shows where capacity is wasted. The useful views are idle cost and unallocated cost per node pool, because those numbers point to scheduling, sizing and reservation problems rather than to any single team. Cost is best read next to requested and used resources so an engineer can see whether a node pool is full of requests that nobody uses.
- Idle cost per node pool: Capacity paid for but not used by any running workload, grouped by node pool and instance type.
- Unallocated cost per node: Node cost that no pod, daemonset or system component claims, which often points to overhead or mis-sized pools.
- Request versus usage gaps: Namespaces or workloads that reserve far more CPU or memory than they use, sorted by the size of the gap.
- System and shared overhead: Control plane, monitoring and ingress costs kept visible so they are not hidden in team totals.
- Trend by pool: Weekly or monthly movement in idle share, to inform node pool resizing and autoscaler settings.
Check that node prices are set per node pool, because a single default price across mixed hardware will misstate idle cost. Confirm how your Prometheus retention covers the windows you report on, since gaps in metrics will show up as gaps in cost.
Team leads need their own namespaces and workloads, in a form they can act on without reading cluster-wide tables. The report should list each namespace they own, the cost trend, the top workloads by cost and the requests that drive spend. Its purpose is to let a team decide whether to tune a deployment, reduce replicas or change a resource request.
- Namespace cost trend: Weekly and monthly cost for each namespace the team owns, with the same cost center label used in finance reporting.
- Top workloads: Deployments, StatefulSets and jobs ranked by cost, with their CPU and memory requests shown beside them.
- Request right-sizing list: Workloads whose requests are well above observed use, presented as a review list rather than a verdict.
- Shared service charges: The share of ingress, logging or monitoring cost attributed to the team, labeled so the team can question the allocation method.
- Change notes: Releases or scaling events that explain a visible jump in cost.
Before sharing, agree with each team lead how shared costs are split and whether the figures are informational only. Team leads who are surprised by an allocation method tend to dispute the numbers rather than act on them.
Using cost data in capacity planning
Cost data from OpenCost answers three planning questions: where capacity sits unused, where requests overstate real need, and where growth is coming from. Each card below ties one of those signals to a decision your team makes about node pools, resource settings, hardware orders or new services.
Idle capacity in node pools
Compare allocated cost per node pool against the resources workloads actually request. Large gaps between node capacity and allocated requests point to node pools sized for peaks that no longer occur. Before removing nodes, check daemonset and system overhead, which OpenCost attributes separately and which does not disappear when workloads move. Confirm that your on-premises rate reflects the hardware you actually own, or the idle figure will be misleading.
Request versus usage gaps
OpenCost prices requests and usage, so a namespace that requests far more CPU or memory than it consumes shows a cost that is mostly reserved, not used. Use this gap to decide which deployments need lower requests, which need limits reviewed, and which owners should be asked to justify their settings. Illustrative example: a team reserving four cores for a service that averages under one core is a tuning conversation, not an automatic change.
Namespace growth for hardware forecasts
Track cost per namespace over several months to see which teams drive growth in cores, memory and storage. The trend, not the current total, is what informs a hardware purchase, because it shows when existing capacity runs out and which team will consume the next increment. Ask each team for planned launches so that the forecast reflects known demand rather than extrapolation alone.
GPU and storage hot spots
GPU nodes and persistent volumes often account for a disproportionate share of spend, and their costs depend on rates your finance team may set differently from CPU and memory. Separate these line items in your reports so that accelerator or storage growth is not hidden inside a general compute total. Confirm which GPU and storage rates are configured in your OpenCost pricing setup before using them to justify a purchase.
Cost per workload before a new service
Before adding a service, estimate its footprint from the requests and cost of similar existing workloads and check whether the target node pool has headroom. This turns a new service request into a costed decision with a named owner. Record the estimate in the same format you use for showback so that the actual cost after launch can be compared against the plan.
Avoiding decisions from one noisy week
Short spikes come from batch jobs, failed rollouts and autoscaling events, and a single week can mislead a purchase or a rightsizing change. Compare at least several weeks of data, filter out known one-off jobs and review the trend before acting. Set a rule in advance for what sustained growth looks like so that the team applies the same test to every namespace.
Questions buyers ask before hiring help with OpenCost
What does the cost and effort of an OpenCost project depend on?
The effort depends mostly on the number of clusters, the pricing model you use for nodes and storage, how consistent your labels are, and the state of your Prometheus setup. A single cluster with clean namespace and team labels and a working Prometheus is a small scope. Several clusters on different hardware, with cloud or on-premises rates that finance has not agreed, add discovery and reconciliation work. Costs are one-time for configuration, pricing model design and report build, and recurring if you keep reports and label rules current. Ask any partner for a quote built from a written scope that lists each cluster, the pricing inputs and the report audience.
How long does a first OpenCost showback report take to produce?
The time depends on scope, so the honest answer is that it cannot be given before the scope is written. The main variables are how many clusters feed the report, whether Prometheus already scrapes the metrics OpenCost needs, how much label cleanup is required, and how many rate inputs finance must supply and approve. A single cluster with existing metrics and agreed rates moves much faster than a multi-cluster estate where ownership labels are missing. Ask the provider to state the duration as a plan with milestones tied to those variables.
What does the work need from our team before it starts?
Three inputs matter most. First, a finance rate card: the per-hour or per-unit prices for CPU, memory, storage and any GPU or network costs, or the on-premises amortization method finance wants to use. Second, a label standard that defines which keys identify namespace, team, cost center and environment, and who owns each value. Third, Prometheus access: a reachable instance that OpenCost can query, with retention long enough to cover the reporting period and the metrics OpenCost reads. Confirm each item with your finance and platform leads before scoping, because gaps there are the usual cause of delay.
Can our platform team set up OpenCost alone?
Often yes for a single cluster with a standard Prometheus stack and a simple pricing model. OpenCost is open source, so the installation, the pricing configuration and the first dashboards can be built by engineers who know Kubernetes and Prometheus. Teams usually need outside help when the on-premises cost model requires finance decisions, when several clusters must report consistently, or when showback must reach budget owners with a defensible method. Check whether your team has the time to maintain label rules and rate changes after launch, since that ongoing work is where internal efforts commonly stall.
What is the difference between showback and chargeback?
Showback reports what each namespace, team or workload consumed so owners can see their costs, but no money moves between budgets. Chargeback allocates those costs to the budgets of the consuming teams or business units, which usually needs finance approval of the method, a stable allocation policy and agreement on how shared costs such as control planes and idle capacity are split. Most organizations start with showback to build trust in the numbers and move to chargeback only after the labels and rates have been stable for a period that finance accepts. Decide early which one you intend, because it changes how strict the label and rate work must be.
Does DeployOpen issue any financial or audit attestation for cost data?
No. DeployOpen configures OpenCost, Prometheus inputs, reports and documentation of the method, and can help prepare the evidence your finance and audit teams review. It does not issue financial statements, audit reports, attestations or certifications of cost figures. Those come from your finance function or an independent auditor you engage. Ask any provider to state in writing what it delivers and what remains your responsibility, including who approves the rate card and who signs off the allocation method.
What should we check in the cost data before sharing it with teams?
Check that every namespace in the report maps to an owner, that unlabeled or system workloads are assigned to a clear bucket, and that the total allocated cost is reconciled against the node and storage costs you expect for the period. Confirm that the Prometheus data covers the whole reporting window without gaps caused by scrape failures or short retention. Review the rate inputs with finance before publication and record which version of the rate card produced each report. Teams act on these numbers, so an error that is discovered after sharing can damage trust in the whole program.
How DeployOpen scopes and delivers OpenCost work
DeployOpen plans and implements OpenCost inside your own clusters and your own Prometheus, so the cost data stays in infrastructure you control. Most engagements are fixed-scope: the scope, deliverables and timeline are agreed in writing before any work starts, and a quote follows from that written scope. A useful scope document names the clusters in the first wave, the Prometheus instance OpenCost will read from and whether that instance already holds the metrics the cost model needs, the rate card inputs (node instance or hardware costs, storage and network prices, and any on-premises amortization assumptions your finance team has approved), the report set (namespace, team and workload showback views and the audience for each), and the handover items such as runbooks, dashboards and the owner of each rate input.
Ask for the scope to state who supplies each input. Rate card values come from your finance or procurement team, not from the implementation itself, and the accuracy of every showback number depends on them. Ask also what is out of scope: for example, whether chargeback invoicing, integration with a finance system, or cost data for clusters outside the first wave is included. Confirm the Kubernetes and monitoring versions named in the scope against the current releases on the Kubernetes releases page before work begins, because version support changes on a published schedule.
Ongoing support is available as a retainer after handover. Typical retainer work covers updating OpenCost when the chart or image changes, reviewing rate inputs when hardware or contract prices change, adjusting reports as teams are added or renamed, and checking that Prometheus retention still covers the periods your showback reports use. Ask any provider to put the retainer scope, response expectations and review cadence in writing as a separate agreement, so the one-time build and the recurring work are priced and owned separately.

