What OpenCost Actually Measures
OpenCost provides a cost model for Kubernetes with two outputs: resource allocation cost and resource usage cost. Allocation cost starts the moment a node is provisioned on the cloud, whether workloads run or not. Usage cost is driven by activity, primarily network egress across zones and regions. For a container, the charge is whichever is higher: what was requested or what was actually consumed. Request one CPU but use 0.25, you still pay for one. Use 1.25 against a one-CPU request, you pay for 1.25.
Efficiency Metrics and Chargeback
Once per-container cost is known, OpenCost rolls it up to pod, deployment, and namespace level, then further to business units for chargeback. Efficiency metrics fall out of the same calculation. Attapattu described seeing grossly oversized pods the first time he deployed it. Pods showing more than 100% efficiency are not a bug: they are using more than they requested. Cloud vendor bills show cost per cluster. OpenCost shows cost per container, giving teams the unit economics to build cost alerts and budgets.
Architecture: Prometheus Dependency and the Promless Alternative
The current OpenCost implementation scrapes usage metrics from kube-state-metrics, fetches cloud API pricing, writes both back as Kubernetes metrics, and exposes aggregation APIs on top. Prometheus sits in the middle. On large clusters with many nodes and pods, that becomes a performance bottleneck. The community built an experimental promless mode that scrapes metrics and writes them directly to disk, removing Prometheus from the path. Attapattu called it a strong fit for clusters with heavy workloads and asked for testers and patch contributors.
MCP Server Demo and the Plugin Architecture
An MCP server, contributed during an LFX internship, exposes OpenCost APIs to AI tooling. Attapattu used the Goose client to ask for the top five most expensive namespaces. The tool called OpenCost’s allocation API and returned cost figures in plain text. The plugin architecture behind this keeps the core project focused on Kubernetes cost only, with no added weight. Existing plugins cover Datadog, OpenAI token cost, and Snowflake (in review). Attapattu flagged plugin ownership as the easiest entry point for new contributors.
KubeModel: Separating Usage Data from Pricing
OpenCost currently writes usage and pricing together into Prometheus, making reconciliation against actual cloud bills awkward. KubeModel separates the two. The simplified model holds only usage data. A later augmented step applies pricing and feeds the allocation and assets APIs. This matters for spot nodes: spot pricing can shift between the time a calculation runs and when a pod actually gets scheduled. Clean separation lets vendors and end users apply their own negotiated rates, something previously only possible through commercial products.
Q&A
Does OpenCost pull from public pricing or internal billing dashboards? OpenCost uses public pricing by default. Vendors override it today, and the KubeModel separation is intended to make that override accessible to anyone. ▶ 28:05
Have floating-point precision errors appeared when summing costs stored as float64? Attapattu said he had not seen a reported complaint but acknowledged it could happen and recommended raising it in the OpenCost Slack channel. ▶ 26:09
Does OpenCost cover infrastructure outside Kubernetes? The project is focused on Kubernetes workloads. A cloud cost section exists but is incomplete for use cases like bare VM costs. LLM cost tracking inside Kubernetes is under active proposal. ▶ 27:02
Notable Quotes
it provides a cost model uh for kubernetes and it provides two things primarily one is the efficiency of your resource usage number two uh is the cost of u your resource usage Rajith Attapattu · ▶ 03:28
some pods were grossly oversized right so you you get that visibility right off the bat where you can see the efficiency Rajith Attapattu · ▶ 09:48
the value is in the APIs. Yeah. And then it’s a it’s a it’s an open source project. So you know help us write the the road map Rajith Attapattu · ▶ 24:24
please don’t get discouraged by the the horrible UI Rajith Attapattu · ▶ 20:12
Key Takeaways
- OpenCost charges whichever is higher: requested resources or actual usage, per container.
- The promless experimental mode removes Prometheus to handle large cluster scale.
- KubeModel separates usage data from pricing to enable accurate after-the-fact reconciliation.
About the Speaker(s)
Rajith Attapattu is founder and CTO of Randoli, an observability platform that includes cost visibility as a core feature. He is a maintainer of the OpenCost project and a member of the Apache Software Foundation. Randoli adopted OpenCost while managing its own infrastructure costs as a startup, then built it into the product and began contributing upstream.