Logan Ballard 08e3e47a07 Updating script in dockerfile entrypoint to run parent containers entrypoint script 3 лет назад
..
src 53d311607a Adding parcel-cache to gitignore 3 лет назад
.babelrc 0aa63fb1f2 A few housekeeping updates for the opencost UI: 3 лет назад
.dockerignore 3734cd3618 Update opencost ui doc 3 лет назад
.nvmrc 0aa63fb1f2 A few housekeeping updates for the opencost UI: 3 лет назад
Dockerfile 08e3e47a07 Updating script in dockerfile entrypoint to run parent containers entrypoint script 3 лет назад
Makefile 08e3e47a07 Updating script in dockerfile entrypoint to run parent containers entrypoint script 3 лет назад
README.md 08e3e47a07 Updating script in dockerfile entrypoint to run parent containers entrypoint script 3 лет назад
default.nginx.conf eab8ec4b7a Fix upstream nginx to access cost-model API. Update README in /ui. 3 лет назад
docker-entrypoint.sh 08e3e47a07 Updating script in dockerfile entrypoint to run parent containers entrypoint script 3 лет назад
nginx.conf a07a4f451c Allow ui to run from non privileged 3 лет назад
package-lock.json 08e3e47a07 Updating script in dockerfile entrypoint to run parent containers entrypoint script 3 лет назад
package.json 0aa63fb1f2 A few housekeeping updates for the opencost UI: 3 лет назад

README.md

OpenCost UI

Installing

See https://www.opencost.io/docs/install for the full instructions.

helm install my-prometheus --repo https://prometheus-community.github.io/helm-charts prometheus \
  --namespace prometheus --create-namespace \
  --set pushgateway.enabled=false \
  --set alertmanager.enabled=false \
  -f https://raw.githubusercontent.com/opencost/opencost/develop/kubernetes/prometheus/extraScrapeConfigs.yaml

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

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 make command.

$ make serve
BASE_URL="/model" npx parcel serve src/index.html
Server running at http://localhost:1234
✨ Built in 1.04s

And can have a custom URL backend prefix.

$ make serve BASE_URL=test
BASE_URL=test npx parcel serve src/index.html
Server running at http://localhost:1234
✨ Built in 746ms

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>