OpenCost — Real-Time Kubernetes Cost Monitoring
Monitor and allocate Kubernetes infrastructure costs in real time. A CNCF sandbox project that gives teams visibility into cluster spend by namespace, pod, and label.
What it is
OpenCost is a CNCF sandbox project that monitors and allocates Kubernetes infrastructure costs in real time. It gives teams visibility into cluster spending broken down by namespace, pod, deployment, and custom labels. OpenCost works with all major cloud providers (AWS, GCP, Azure) and on-premise clusters, pulling actual pricing data to calculate accurate per-workload costs.
Platform engineering teams and DevOps engineers managing Kubernetes clusters benefit most from OpenCost. It answers the question 'which team or service is driving our cloud bill' without requiring manual spreadsheet analysis.
How it saves time or tokens
OpenCost automates cost attribution that otherwise requires manual cross-referencing of cloud billing dashboards with Kubernetes resource usage. Instead of spending hours parsing invoices and mapping them to workloads, teams get a real-time dashboard showing exactly where money is going. For AI workloads running on GPU nodes, this visibility helps identify idle resources quickly.
How to use
- Install OpenCost via Helm into your Kubernetes cluster
- Configure your cloud provider pricing source (or use on-prem custom pricing)
- Access the web UI or API to view cost breakdowns by namespace, pod, or label
Example
# Install via Helm
helm repo add opencost https://opencost.github.io/opencost-helm-chart
helm install opencost opencost/opencost \
--namespace opencost --create-namespace
# Port-forward to access the UI
kubectl port-forward -n opencost \
svc/opencost 9090:9090
# Open http://localhost:9090 for the cost dashboard
# Or query the API:
curl http://localhost:9090/allocation/compute?window=7d
Related on TokRepo
- DevOps tools — Explore Kubernetes and infrastructure management tools
- Monitoring tools — Browse observability and monitoring solutions
Common pitfalls
- Cloud provider pricing APIs require proper IAM permissions; misconfigured access leads to inaccurate cost data
- On-premise clusters need manual pricing configuration since there is no cloud billing API to query
- OpenCost measures resource allocation, not actual utilization; over-provisioned pods show higher costs than they truly consume
Frequently Asked Questions
OpenCost supports AWS, Google Cloud, Azure, and on-premise clusters. For cloud providers, it pulls actual pricing data from billing APIs. For on-premise setups, you configure custom per-resource pricing.
Yes. OpenCost is open-source under the Apache 2.0 license and a CNCF sandbox project. There are no licensing fees. Kubecost offers a commercial version with additional features built on the same core.
OpenCost uses actual cloud provider pricing data and real resource allocation from the Kubernetes API. Accuracy depends on correct pricing source configuration. Spot instance and reserved pricing require additional setup.
Yes. OpenCost breaks down costs by namespace, label, deployment, pod, and container. If your teams use separate namespaces or consistent labels, you get automatic per-team cost attribution.
Yes. OpenCost tracks GPU resource allocation and costs. It supports NVIDIA GPU pricing on cloud providers, making it useful for teams running AI training or inference workloads on Kubernetes.
Citations (3)
- OpenCost GitHub— CNCF sandbox project for Kubernetes cost monitoring
- OpenCost Documentation— Real-time cost allocation by namespace, pod, and label
- CNCF Landscape— CNCF sandbox project status
Related on TokRepo
Discussion
Related Assets
WCDB — WeChat Cross-Platform Database Framework
A high-performance, cross-platform database framework developed by WeChat, built on SQLite with ORM, encryption, repair, and migration capabilities.
sql.js — Run SQLite in the Browser with WebAssembly
A JavaScript library that compiles SQLite to WebAssembly, letting you run a full SQL database entirely in the browser or Node.js.
Realm — High-Performance Mobile Database
A fast, object-oriented mobile database designed as a modern replacement for SQLite and Core Data on iOS and Android.