The OpenCost web interface
Go to file
Alex Meijer c855f42c00
Merge pull request #94 from opencost/dependabot/github_actions/tspascoal/get-user-teams-membership-3
Bump tspascoal/get-user-teams-membership from 2 to 3
2025-08-07 13:53:36 -04:00
.github Merge branch 'main' into dependabot/github_actions/tspascoal/get-user-teams-membership-3 2025-08-07 13:53:28 -04:00
src fix images and loading of external costs 2025-07-27 09:24:20 +02:00
.babelrc A few housekeeping updates for the opencost UI: 2023-01-04 14:18:00 -07:00
.dockerignore Update opencost ui doc 2022-11-18 13:20:10 +08:00
.gitignore Duplication GitHub configuration from opencost and tailor to only UI 2024-05-11 18:25:10 +10:00
.nvmrc A few housekeeping updates for the opencost UI: 2023-01-04 14:18:00 -07:00
Dockerfile fix: update oci source label 2024-06-08 21:11:55 +02:00
Dockerfile.cross fix: update oci source label 2024-06-08 21:11:55 +02:00
Dockerfile.debug fix: update oci source label 2024-06-08 21:11:55 +02:00
LICENSE Include the proper license. 2024-06-11 17:23:30 +10:00
README.md Update README.md 2025-08-01 21:07:36 +05:30
THIRD_PARTY_LICENSES.txt Add THIRD_PARTY_LICENSES.txt from OpenCost. 2024-05-11 17:43:36 +10:00
default.nginx.conf.template Enable setting the API_SERVER for use with Docker 2023-12-06 00:24:19 +11:00
docker-entrypoint.sh docker-entrypoint.sh: only create /etc/nginx/conf.d/default.nginx.conf if it does not yet exist (fix #4) 2024-12-04 14:07:18 +01:00
justfile remove copy thirdparty licenses Signed-off-by: Cliff Colvin <ccolvin@kubecost.com> 2024-06-25 17:52:10 -05:00
nginx.conf Allow ui to run from non privileged 2022-12-16 12:58:27 +00:00
package-lock.json Bump @babel/core from 7.26.8 to 7.28.0 2025-07-28 05:16:58 +00:00
package.json Bump @babel/core from 7.26.8 to 7.28.0 2025-07-28 05:16:58 +00:00

README.md

License

OpenCost UI

This is the web UI for the OpenCost project. You can learn more about the User Interface in the OpenCost docs.

OpenCost UI Walkthrough OpenCost UI Walkthrough

Installing

See Installation Guide for the full instructions.

Using

After following the installation instructions, access the UI by port forwarding:

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

Running Locally

The UI can be run locally using the npm run serve command.

$ npm install
...
$ npm run serve
> opencost-ui@0.1.0 serve
> npx parcel serve src/index.html

Server running at http://localhost:1234
✨ Built in 1.96s

And can have a custom URL backend prefix.

BASE_URL=http://localhost:9090/test npm run serve

> opencost-ui@0.1.0 serve
> npx parcel serve src/index.html

Server running at http://localhost:1234
✨ Built in 772ms

In addition, similar behavior can be replicated with the docker container:

$ docker run -e BASE_URL_OVERRIDE=test -p 9091:9090 -d opencost-ui:latest
$ curl localhost:9091
<html gibberish>

Overriding the Base API URL

For some use cases such as the case of OpenCost deployed behind an ingress controller, it is useful to override the BASE_URL variable responsible for requests sent from the UI to the API. This means that instead of sending requests to <domain>/model/allocation/compute/etc, requests can be sent to <domain>/{BASE_URL_OVERRIDE}/allocation/compute/etc. To do this, supply the environment variable BASE_URL_OVERRIDE to the docker image.

$ docker run -p 9091:9090 -e BASE_URL_OVERRIDE=anything -d opencost-ui:latest