Skip to main content

OpenCost Setup

There are several supported ways of deploying OpenCost, depending on your use case and environment. Each cloud provider has different configuration requirements depending on your deployment. For full OpenCost functionality (Kubernetes Cost Allocations, Cloud Costs, and the web UI), we recommend deploying with Helm and following the instructions specific to your cloud provider:

Requirements

OpenCost requires a Kubernetes cluster to be deployed. Users should be running Kubernetes 1.21+ and Kubernetes 1.28 is officially supported as of v1.105.

OpenCost requires Prometheus for scraping metrics and data storage.

Accessing OpenCost

Once your OpenCost has been installed, wait for the pods to be ready and port forward with:

kubectl port-forward --namespace opencost service/opencost 9003 9090

To verify that the UI and server are running, you may connect to the OpenCost UI at http://localhost:9090.

To verify that the server is running, access http://localhost:9003/allocation/compute?window=60m

Accessing OpenCost Data

Beyond the OpenCost UI, you may access the cost monitoring data for OpenCost through:

Updating OpenCost

Depending on how you installed OpenCost, it may be a matter of updating the Helm chart to the latest version or updating the version number in your values.yaml or manifest. Data is stored in Prometheus, so upgrading/downgrading should not impact the recorded data.

Uninstalling OpenCost

Depending on how you installed OpenCost, you may uninstall the release and delete the opencost namespace.

$ helm uninstall opencost
$ kubectl delete namespace opencost

If you wish to delete the Prometheus data, uninstall the release and delete the prometheus-server namespace.

$ helm uninstall prometheus
$ kubectl delete namespace prometheus-system

If you installed with the manifest, enter the following command:

kubectl delete -f https://raw.githubusercontent.com/opencost/opencost/develop/kubernetes/opencost.yaml

Help

Please let us know if you run into any issues, we are here to help!

Join us on CNCF Slack in the #opencost channel if you have questions or contact us via email (opencost@kubecost.com).

Documentation Distributed under CC BY 4.0.  The Linux Foundation® (TLF) has registered trademarks and uses trademarks. For a list of TLF trademarks, see: Trademark Usage.