Kubecost

On this page 7

Kubecost is a cost monitoring and optimization platform for Kubernetes that measures how much each namespace, workload, label and team actually costs by combining cluster resource metrics with cloud billing data. In Cloud economics, it fills the visibility gap that appears when many applications share the same nodes, so a single cloud invoice line for virtual machines can be broken down into per-workload costs.

Kubecost is built on OpenCost, the open-source Kubernetes cost allocation specification and engine that it originally created and contributed to the Cloud Native Computing Foundation. The commercial product adds multi-cluster views, governance features and enterprise support, and it is now part of IBM’s portfolio of FinOps tools.

How Kubecost calculates Kubernetes costs

Kubecost calculates costs by pricing each unit of resource that a container reserves or consumes and multiplying it by time. It reads usage and request metrics through Prometheus, determines node prices from public price lists or custom pricing, and later reconciles those estimates against the provider’s actual bill, including discounts.

For each container, the cost model typically charges the greater of requested and used resources, because a request reserves capacity that other pods cannot use. Capacity that no workload claims becomes idle cost, which can be shown separately or spread across tenants.

The table below lists the main cost inputs and how they are measured.

ComponentMeasurement unitMain data source
CPUCore-hoursRequests and usage from Prometheus
MemoryGigabyte-hoursRequests and usage from Prometheus
GPUGPU-hoursDevice requests on the node
Persistent volumesGigabyte-hours of claimed storagePersistentVolume and claim metadata
Network egressGigabytes transferredOptional network cost collector
Out-of-cluster assetsBilled amountCloud billing export or Cost and Usage Report
Cost components in the Kubecost model

Billing reconciliation matters because list prices ignore Reserved Instances, Savings Plans, Spot discounts and negotiated rates. Without it, allocated costs can deviate noticeably from the invoice that finance actually pays.

Cost allocation, showback and chargeback

Kubecost turns raw resource data into cost allocation along any Kubernetes dimension, which makes it a practical engine for showback and chargeback in platform teams. Costs can be aggregated by cluster, namespace, controller, pod, container or any label and annotation, such as team, product or environment.

Shared costs, for example monitoring stacks, ingress controllers or the kube-system namespace, can be distributed to tenants evenly or in proportion to their own spend. The choice of method changes how fair the report feels to internal customers, so it should be agreed with finance in advance.

DimensionAnswers the questionTypical consumer
NamespaceWhat does each application environment costPlatform engineering
Team labelWhich team should be chargedFinance and FinOps
Deployment or controllerWhich service drives spendApplication owners
ClusterHow do clusters compare in efficiencyInfrastructure leads
Environment labelHow much do non-production systems costEngineering management
Common allocation dimensions

Allocation quality depends directly on consistent resource tagging and labeling. Unlabeled workloads end up in an unallocated bucket, which weakens accountability.

Optimization recommendations

Beyond reporting, Kubecost generates savings recommendations that estimate how much monthly spend each action could remove. The most valuable ones usually target overprovisioned resource requests, which inflate node counts across the cluster.

RecommendationWhat it detectsMain risk if applied blindly
Request rightsizingRequests far above observed usageThrottling or out-of-memory kills at peaks
Cluster rightsizingToo many or wrongly sized nodesInsufficient headroom during scaling
Abandoned workloadsPods with almost no trafficRemoving rarely used but critical jobs
Unclaimed volumesDisks not attached to any podDeleting data still needed for recovery
Spot readinessWorkloads tolerant of interruptionDisruption of stateful services
Typical Kubecost savings recommendations

Recommendations are based on historical usage windows, so a short window can miss monthly batch peaks. Experienced teams review them against service-level objectives and apply changes gradually, often through autoscaling policies rather than manual edits.

Kubecost compared with other cost tools

Kubecost differs from native provider consoles because it understands Kubernetes objects inside shared nodes, whereas AWS Cost Explorer or Azure Cost Management see mainly the underlying virtual machines and disks. It complements those tools rather than replacing them.

ToolGranularityStrengthLimitation
OpenCostPod and containerFree, open specificationFewer enterprise and multi-cluster features
KubecostPod, label, teamAllocation plus recommendationsAdvanced features need a paid tier
AWS Cost ExplorerService and resourceNative billing accuracyNo visibility into pods on shared nodes
Azure Cost ManagementResource and tagBudgets and native exportsLimited container-level detail
Kubecost and related cost tools

Many organizations export Kubecost allocation data into a central FinOps platform, increasingly in the FOCUS billing format, so that Kubernetes costs appear next to other cloud services.

Deployment considerations and limitations

Kubecost is usually installed inside each cluster with a Helm chart, together with a Prometheus instance or an existing metrics source. Larger estates add a central aggregation layer for multi-cluster reporting and long-term retention.

  • Metrics retention limits history: short Prometheus retention shortens the window available for analysis.
  • Requests drive cost: workloads without requests appear cheap even when they consume shared capacity.
  • Idle cost needs a policy: hiding it makes teams look efficient while the cluster stays underused.
  • Network costs are approximate unless the dedicated collector and accurate pricing are configured.
  • Recommendations are advisory: they do not replace load testing or capacity planning.

Access control also deserves attention, because cost reports reveal workload names, team structures and spending levels. Organizations commonly restrict the dashboard to platform and FinOps staff, expose filtered views to individual teams, and treat exported allocation data with the same care as other internal financial records.

In plain words

Kubecost works like an itemized receipt for a shared apartment. The cloud provider sends one big bill for the building. Kubecost works out how much of it belongs to each roommate. It looks at the rooms they reserved and how much they used.

It also points out wasted space. These are rooms reserved but almost never used. The group can then stop paying for capacity nobody needs.

A real-world example

A software company runs 12 product teams on two shared Kubernetes clusters in one cloud region. The monthly compute bill keeps growing, but the provider invoice shows only node groups, so no team feels responsible for the increase.

The platform team installs Kubecost, enforces a mandatory team label through an admission policy and enables billing reconciliation with the company’s Savings Plans. The first report shows that about a third of the requested CPU is idle and that two teams account for most of the growth because their memory requests are several times higher than real usage.

Over the next quarter, teams apply request rightsizing in stages, the cluster autoscaler removes surplus nodes, and finance starts monthly showback reports per team. The result is a visibly lower compute bill and a clear owner for every major cost line.