Skip to main content

Installing on OVHcloud

OpenCost may be installed on Kubernetes clusters running on OVHcloud, including Managed Kubernetes Service (MKS) clusters.

You will need to install Prometheus, create your OpenCost namespace, configure your cluster pricing and cloud costs, and then install OpenCost.

info

OVHcloud support is available starting from the next release after 1.119.2. If you need it before the official release, you may use the develop-latest image tag.

Install Prometheus

Prometheus is a prerequisite for OpenCost installation. OpenCost requires Prometheus for scraping metrics and data storage. For the installation of Prometheus please 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 \
-f https://raw.githubusercontent.com/opencost/opencost/develop/kubernetes/prometheus/extraScrapeConfigs.yaml

This will install Prometheus in the prometheus-system namespace with default settings for use with OpenCost.

If you wish to use a different Prometheus installation or work with another compatible technology, please refer to the Prometheus installation page.

tip

If you are using kube-prometheus-stack (Prometheus Operator), you can skip the extraScrapeConfigs and enable the ServiceMonitor in the OpenCost Helm chart instead:

opencost:
metrics:
serviceMonitor:
enabled: true
additionalLabels:
release: <your-prometheus-stack-release-name>

Create the OpenCost Namespace

Create the opencost namespace for your installation:

kubectl create namespace opencost

Alternate namespaces may be used if necessary.

OVHcloud Configuration

Cost Allocation

OpenCost will automatically detect OVHcloud as the cloud service provider (CSP) by reading node labels. When the label node.k8s.ovh/type is present, OpenCost identifies the cluster as running on OVHcloud.

Once detected, OpenCost retrieves real-time pricing data from the OVH Public Cloud Catalog API. This includes:

  • Instance pricing: hourly and monthly rates for all Public Cloud flavors (general purpose, CPU, RAM, GPU, discovery, IOPS)
  • Volume pricing: per-GB/hour rates for all Cinder volume types (classic, high-speed, high-speed-gen2)

No API key is required to retrieve the public pricing data.

Environment Variables

The following optional environment variables may be used to customize OVHcloud pricing behavior:

VariableDefaultDescription
OVH_SUBSIDIARYFROVH subsidiary for catalog pricing (e.g., FR, DE, US, GB). Determines the currency and regional pricing.
OVH_MONTHLY_NODEPOOLS(empty)Comma-separated list of nodepool names that use monthly billing instead of hourly consumption pricing.
REGION_OVERRIDE_LIST(empty)Comma-separated list of OVH regions to query. Overrides the built-in region list if set.

Monthly vs. Hourly Pricing

OVHcloud offers both hourly (consumption) and monthly billing for Public Cloud instances. By default, OpenCost uses hourly pricing for all nodes. If some of your nodepools use monthly billing, set the OVH_MONTHLY_NODEPOOLS environment variable:

opencost:
exporter:
extraEnv:
OVH_MONTHLY_NODEPOOLS: "my-monthly-pool,another-monthly-pool"

Monthly prices are converted to an equivalent hourly rate (monthly price / 730 hours) for consistent cost allocation.

Alternatively, you can override billing mode per node using the ovh.opencost.io/billing label with a value of monthly or hourly:

kubectl label node <node-name> ovh.opencost.io/billing=monthly

This label takes precedence over the OVH_MONTHLY_NODEPOOLS environment variable for the labeled node.

Persistent Volume Pricing

OpenCost automatically prices Persistent Volumes backed by OVHcloud Cinder CSI. The volume type is resolved from:

  1. A built-in mapping of StorageClass names to OVH volume types
  2. The type parameter in the StorageClass specification (fallback)

Supported volume types include classic, high-speed, and high-speed-gen2 (plus their -luks encrypted variants).

Custom Pricing

If you need to override the default OVHcloud pricing retrieved from the catalog API, you may provide custom pricing in your Helm values:

opencost:
customPricing:
enabled: true
provider: ovh
costModel:
description: Custom OVH pricing overrides
CPU: "0.03405"
RAM: "0.009729"
GPU: "1.80"
storage: "0.000119"

OVHcloud Cloud Costs

note

Cloud Costs are not currently supported for OVHcloud. Support is planned for a future release.

Install OpenCost

Helm is the preferred installation method for OpenCost.

Using the OpenCost Helm Chart

You may check out the source for the OpenCost Helm Chart or you may install the Helm chart directly to your Kubernetes cluster. Review the values.yaml for the settings available for customization. With your custom settings in the Helm values file local.yaml, install OpenCost:

helm install opencost --repo https://opencost.github.io/opencost-helm-chart opencost \
--namespace opencost -f local.yaml

To enable the OVHcloud provider explicitly (e.g., when running outside an MKS cluster), set the CLOUD_PROVIDER environment variable:

opencost:
exporter:
extraEnv:
CLOUD_PROVIDER: "OVH"

Updating OpenCost via Helm

Upgrading the Helm chart version or updating settings may be done with the following:

helm upgrade opencost --repo https://opencost.github.io/opencost-helm-chart opencost \
--namespace opencost -f local.yaml

Installing with the OpenCost Manifest

Installing from the OpenCost manifest is supported on OVHcloud.

For basic Kubernetes Cost Allocations without Cloud Costs or any customizations you may use the OpenCost manifest. Prometheus is still required and the Helm chart installation is recommended for anything beyond this simple use case.

kubectl apply --namespace opencost -f https://raw.githubusercontent.com/opencost/opencost/develop/kubernetes/opencost.yaml
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.