
OpenCost Has a Free API: Track Your Kubernetes Spending in Real-Time
What is OpenCost? OpenCost is an open-source CNCF project that provides real-time cost monitoring for Kubernetes clusters. It breaks down your cloud bill by namespace, deployment, pod, and even container — showing exactly where your money goes. Why OpenCost? 100% free and open-source — CNCF sandbox project Real-time cost allocation — not monthly bills, but live spending Multi-cloud — AWS, GCP, Azure, on-prem pricing Namespace-level — chargeback per team/service Prometheus integration — export cost metrics alongside performance data No vendor lock-in — unlike Kubecost Pro or CloudHealth Quick Start # Install via Helm helm install opencost opencost/opencost \ --namespace opencost --create-namespace \ --set opencost.prometheus.internal.enabled = true # Port forward to UI kubectl port-forward -n opencost svc/opencost 9090:9090 # Open http://localhost:9090 Query Costs via API # Get cost allocation by namespace (last 24h) curl -s 'http://localhost:9090/allocation/compute?window=24h&aggregate
Continue reading on Dev.to DevOps
Opens in a new tab



