Prometheus is a prerequisite for OpenCost installation. OpenCost requires Prometheus for scraping metrics and data storage. For express installation of Prometheus use the following command:
helm install prometheus --repo https://prometheus-community.github.io/helm-charts prometheus \
--namespace prometheus-system --create-namespace \
--set prometheus-pushgateway.enabled=false \
--set alertmanager.enabled=false \
This Prometheus installation is based on the Prometheus Community Kubernetes Helm Chart and by default your Prometheus may scrape unnecessary metrics. For production, you may refer to the Kubecost user metrics list to filter with
keep and for reference look at the scrape config in the Kubecost installation chart.
If you are going to connect existing Prometheus instance which is already consuming KSM metrics, please consider visiting this page about KSM metrics emission because OpenCost currently implements the same architecture and you might get overlapping metrics.
At this point you can proceed to installing OpenCost.
Providing your own Prometheus
If you want to use your own Prometheus:
- Set the
PROMETHEUS_SERVER_ENDPOINTenvironment variable to the address of your Prometheus server.
- Add the scrapeConfig to it, using the preferred means for your Prometheus install (ie.
- Consider using the OpenCost Helm Chart for additional Prometheus configuration options.