opencost /opencost

Cost monitoring for Kubernetes workloads and cloud costs

★ 6,802⑂ 916👁 50⑃ 2,895● 865▤ 76
GoCreated 2019-03-28opencost.io
6,802
stars
+0+0+34
916
forks
50
watchers
2,895
prs
865
issues
76
releases
–
discussions

README

!

 OpenCost — your favorite open source cost monitoring tool for Kubernetes and cloud spend

OpenCost give teams visibility into current and historical Kubernetes and cloud spend and resource allocation.
These models provide cost transparency in Kubernetes environments that support multiple applications, teams, departments, etc.
It also provides visibility into the cloud costs across multiple providers.

OpenCost was originally developed and open sourced by Kubecost. This project combines a specification as well as a Golang implementation of these detailed requirements. The web UI is available in the opencost/opencost-ui repository.


OpenCost UI Walkthrough

To see the full functionality of OpenCost you can view OpenCost features. Here is a summary of features enabled:

- Real-time cost allocation by Kubernetes cluster, node, namespace, controller kind, controller, service, or pod
- Multi-cloud cost monitoring for all cloud services on AWS, Azure, GCP
- Dynamic on-demand k8s asset pricing enabled by integrations with AWS, Azure, and GCP billing APIs
- Supports on-prem k8s clusters with custom CSV pricing
- Allocation for in-cluster K8s resources like CPU, GPU, memory, and persistent volumes
- Easily export pricing data to Prometheus with /metrics endpoint (learn more)
- Carbon costs for cloud resources
- MCP support
- AI inference cost tracking for vLLM-based deployments (llm-d and compatible): cost per million tokens (input/output), KV cache-corrected pricing, shared infrastructure attribution, REST APIs and Prometheus metrics
- Support for external costs like Datadog through OpenCost Plugins
- Free and open source distribution (Apache2 license)

 Getting Started

OpenCost is now installed and managed via the official Helm chart only.

Quick install on any Kubernetes 1.20+ cluster:

bash
helm repo add opencost https://opencost.github.io/opencost-helm-chart
helm repo update
helm install opencost opencost/opencost


Note: The standalone Kubernetes manifest files have been removed. Please use Helm for all installations and upgrades. See the Helm installation docs for details and configuration.

 Note for sharded Prometheus users:
 If you run Prometheus in a sharded (HA) setup, set PROMETHEUS_SERVER_ENDPOINT to a global query endpoint (e.g., Thanos Query, Cortex, or Mimir). Pointing to a single Prometheus pod may result in incomplete or intermittent export results. See the Prometheus integration docs for details.

 Usage

- Cost APIs
- CLI / kubectl cost
- Prometheus Metrics
- User Interface
- AI Inference Cost Tracking

 MCP Server

The OpenCost MCP (Model Context Protocol) server provides AI agents with access to cost allocation and asset data through a standardized interface. The MCP server is disabled by default (opt-in) in all OpenCost deployments, runs on port 8081, and is built into the Helm chart for easy production deployment. Users have full control to enable it or configure custom ports and settings.

 Features

- Opt-in by Default: MCP

Snapshot: 2026-11-04T14:00:00Z · Data license Apache-2.0 · JSON