opencost

by OpenCost

Helm chartv2.5.35App 1.121.5Verified publisher

OpenCost and OpenCost UI

About this chart

opencost

OpenCost and OpenCost UI

Maintainers

NameEmailUrl
jessegoodier
toscott
mittal-ishaan
brito-rafa[email protected]

Installing the Chart

To install the chart with the release name opencost:

$ helm install opencost opencost/opencost

Values

KeyTypeDefaultDescription
annotationsobject{}Annotations to add to the all the resources
clusterNamestring"cluster.local"Override the default name of cluster - Can be found in /etc/kubernetes/admin.conf: clusters -> cluster -> name
external.nodeLabels.configMapNamestring""
external.nodeLabels.keystring""
external.nodeLabels.namespacestring""
external.nodeLabels.routestring""
extraObjectslist[]Array of extra K8s manifests rendered through tpl and owned by the release.
extraVolumeslist[]A list of volumes to be added to the pod
fullnameOverridestring""Overwrite all resources name created by the chart
imagePullSecretslist[]List of secret names to use for pulling the images
loglevelstring"info"
nameOverridestring""Overwrite the default name of the chart
namespaceOverridestring""Override the deployment namespace
networkPolicies.enabledboolfalseSpecifies whether networkpolicies should be created
networkPolicies.extraEgresslist[]Extra egress rule
networkPolicies.prometheusobject{"labels":{"app.kubernetes.io/name":"prometheus"},"namespace":"prometheus-system","port":9090}Internal Prometheus settings related to NetworkPolicies
networkPolicies.prometheus.labelsobject{"app.kubernetes.io/name":"prometheus"}Labels applied to the Prometheus server pod(s)
networkPolicies.prometheus.namespacestring"prometheus-system"Namespace where internal Prometheus is installed
networkPolicies.prometheus.portint9090Pod port of in-cluster Prometheus
opencost.affinityobject{}Affinity settings for pod assignment
opencost.carbonCost.enabledboolfalseEnable carbon cost exposed in the API
opencost.cloudCost.enabledboolfalseEnable cloud cost ingestion and querying, dependant on valid integration credentials
opencost.cloudCost.monthToDateIntervalint6The number of standard runs before a Month-to-Date run occurs
opencost.cloudCost.queryWindowDaysint7The max number of days that any single query will be made to construct Cloud Costs
opencost.cloudCost.refreshRateHoursint6Number of hours between each run of the Cloud Cost pipeline
opencost.cloudCost.runWindowDaysint3Number of days into the past that a Cloud Cost standard run will query for
opencost.cloudIntegrationJSONstring""Raw JSON for cloud-integration.json. Creates a Secret named <fullname>-cloud-integration in the release namespace. Mutually exclusive with opencost.cloudIntegrationSecret.
opencost.cloudIntegrationSecretstring""Existing Secret containing cloud-integration.json for Cloud Costs. See https://www.opencost.io/docs/configuration/#cloud-costs. Create with: kubectl create secret generic <SECRET_NAME> --from-file=cloud-integration.json -n opencost. Mutually exclusive with opencost.cloudIntegrationJSON.
opencost.customPricing.configPathstring"/tmp/custom-config"Path for the pricing configuration.
opencost.customPricing.configmapNamestring"custom-pricing-model"Customize the configmap name used for custom pricing
opencost.customPricing.costModelobject{"CPU":1.25,"GPU":0.95,"RAM":0.5,"description":"Modified pricing configuration.","discount":"","internetNetworkEgress":0.12,"regionNetworkEgress":0.01,"spotCPU":0.006655,"spotRAM":0.000892,"storage":0.25,"zoneNetworkEgress":0.01}More information about these values here: https://www.opencost.io/docs/configuration/on-prem#custom-pricing-using-the-opencost-helm-chart
opencost.customPricing.createConfigmapbooltrueConfigures the pricing model provided in the values file.
opencost.customPricing.enabledboolfalseEnables custom pricing configuration
opencost.customPricing.providerstring"custom"Sets the provider type for the custom pricing file.
opencost.exporter.adminToken.enabledboolfalseWhen true, the chart creates the admin-token Secret (if value is set) or mounts existingSecret as ADMIN_TOKEN. When false, ADMIN_TOKEN is not set and no secret is deployed.
opencost.exporter.adminToken.existingSecretstring""Use an existing Secret for the admin token (recommended). Secret must contain the key below.
opencost.exporter.adminToken.secretKeystring"ADMIN_TOKEN"Key in the Secret that holds the admin token (used for both value-created and existing secrets).
opencost.exporter.adminToken.valuestring""If set, the chart creates a Secret with this value and sets ADMIN_TOKEN from it (not recommended for production; use existingSecret instead).
opencost.exporter.apiHttpRouteobject{"annotations":{},"enabled":false,"hostnames":[],"labels":{},"parentRefs":[{"name":"","namespace":"","sectionName":""}],"rules":[{"backendRefs":[{"name":"","port":9003}],"matches":[{"path":{"type":"PathPrefix","value":"/"}}]}]}HTTPRoute for OpenCost API (Gateway API)
opencost.exporter.apiHttpRoute.annotationsobject{}Annotations for HTTPRoute resource
opencost.exporter.apiHttpRoute.enabledboolfalseEnable HTTPRoute resource
opencost.exporter.apiHttpRoute.hostnameslist[]Hostnames for the HTTPRoute
opencost.exporter.apiHttpRoute.labelsobject{}Labels for HTTPRoute resource
opencost.exporter.apiHttpRoute.parentRefslistSee values.yamlGateway API parent references
opencost.exporter.apiHttpRoute.ruleslistSee values.yamlHTTPRoute rules. Each rule supports an optional filters list at the rule level and per-backendRef filters for Gateway API filter configuration (e.g. basic auth via ExtensionRef, header modification via RequestHeaderModifier, etc.).
opencost.exporter.apiIngress.annotationsobject{}Annotations for Ingress resource
opencost.exporter.apiIngress.enabledboolfalseIngress for OpenCost API
opencost.exporter.apiIngress.hostslistSee values.yamlA list of host rules used to configure the Ingress
opencost.exporter.apiIngress.ingressClassNamestring""Ingress controller which implements the resource
opencost.exporter.apiIngress.servicePortstring"http"Redirect ingress to an extraPort defined on the service such as oauth-proxy
opencost.exporter.apiIngress.tlslist[]Ingress TLS configuration
opencost.exporter.apiPortint9003
opencost.exporter.aws.access_key_idstring""AWS secret key id
opencost.exporter.aws.secret_access_keystring""AWS secret access key
opencost.exporter.cloudProviderApiKeystring""The GCP Pricing API requires a key. This is supplied just for evaluation.
opencost.exporter.collectorDataSource.enabledboolfalse
opencost.exporter.collectorDataSource.networkPortint3001The port at which network pods are open to egress
opencost.exporter.collectorDataSource.retention10mint36The number of 10m intervals the Collector DataSource should maintain
opencost.exporter.collectorDataSource.retention1dint15The number of 1d intervals the Collector DataSource should maintain
opencost.exporter.collectorDataSource.retention1hint49The number of 1h intervals the Collector DataSource should maintain
opencost.exporter.collectorDataSource.scrapeIntervalstring"30s"define the interval at which the collector scrapes for data points (10s, 15s, 1m)
opencost.exporter.commandlist[]Optional command to override the default container command
opencost.exporter.csv_pathstring""
opencost.exporter.defaultClusterIdstring"default-cluster"Default cluster ID to use if cluster_id is not set in Prometheus metrics.
opencost.exporter.envlist[]List of additional environment variables to set in the container
opencost.exporter.extraArgslist[]List of extra arguments for the command, e.g.: log-format=json
opencost.exporter.extraEnvobject{}Any extra environment variables you would like to pass on to the pod
opencost.exporter.extraEnvFromlist[]Extra environment variables from secrets or configmaps
opencost.exporter.extraVolumeMountslist[]A list of volume mounts to be added to the pod
opencost.exporter.imageobject{"fullImageName":null,"pullPolicy":"IfNotPresent","registry":"ghcr.io","repository":"opencost/opencost","tag":"1.121.5@sha256:29e7becb7b04b935d85031c7fb43bb3731b53899b3f05353c83c5850619ade3e"}This overrides the above defaultClusterId. Ensure the ConfigMap exists and contains the required CLUSTER_ID key. clusterIdConfigmap: cluster-id-configmap
opencost.exporter.image.fullImageNamestringnilOverride the full image name for development purposes
opencost.exporter.image.pullPolicystring"IfNotPresent"Exporter container image pull policy
opencost.exporter.image.registrystring"ghcr.io"Exporter container image registry
opencost.exporter.image.repositorystring"opencost/opencost"Exporter container image name
opencost.exporter.image.tagstring"1.121.5@sha256:29e7becb7b04b935d85031c7fb43bb3731b53899b3f05353c83c5850619ade3e"Exporter container image tag
opencost.exporter.inferenceCostTracking.collectionIntervalstring"2m"Background collection interval
opencost.exporter.inferenceCostTracking.enabledboolfalseEnable inference cost tracking
opencost.exporter.inferenceCostTracking.modelLabelstring"llm-d.ai/model"Pod label whose value is the vLLM model name. Must match the model_name label on vLLM Prometheus metrics
opencost.exporter.inferenceCostTracking.sharedInfraLabelstring"llm-d.ai/inference-shared"Pod label key identifying shared infra pods (EPP, gateway)
opencost.exporter.inferenceCostTracking.sharedInfraLabelValuestring"true"Label value that marks a pod as shared infra
opencost.exporter.livenessProbe.enabledbooltrueWhether probe is enabled
opencost.exporter.livenessProbe.failureThresholdint3Number of failures for probe to be considered failed
opencost.exporter.livenessProbe.initialDelaySecondsint10Number of seconds before probe is initiated
opencost.exporter.livenessProbe.pathstring"/healthz"Probe path
opencost.exporter.livenessProbe.periodSecondsint20Probe frequency in seconds
opencost.exporter.livenessProbe.timeoutSecondsint1Number of seconds after which the probe times out
opencost.exporter.persistence.accessModestring""Access mode for persistent volume
opencost.exporter.persistence.annotationsobject{}Annotations for persistent volume
opencost.exporter.persistence.enabledboolfalse
opencost.exporter.persistence.mountPathstring"/mnt/export"The path that the PV will be mounted to the exporter at
opencost.exporter.persistence.sizestring""Size for persistent volume
opencost.exporter.persistence.storageClassstring""Storage class for persistent volume
opencost.exporter.prometheusDataSource.queryResolutionSecondsint300
opencost.exporter.readinessProbe.enabledbooltrueWhether probe is enabled
opencost.exporter.readinessProbe.failureThresholdint3Number of failures for probe to be considered failed
opencost.exporter.readinessProbe.initialDelaySecondsint10Number of seconds before probe is initiated
opencost.exporter.readinessProbe.pathstring"/healthz"Probe path
opencost.exporter.readinessProbe.periodSecondsint10Probe frequency in seconds
opencost.exporter.readinessProbe.successThresholdint1Minimum consecutive successes for the probe to be considered successful after having failed
opencost.exporter.readinessProbe.timeoutSecondsint1Number of seconds after which the probe times out
opencost.exporter.replicasint1Number of OpenCost replicas to run
opencost.exporter.resources.limitsobject{"memory":"1Gi"}CPU/Memory resource limits
opencost.exporter.resources.requestsobject{"cpu":"10m","memory":"55Mi"}CPU/Memory resource requests
opencost.exporter.securityContextobject{}The security options the container should be run with
opencost.exporter.startupProbe.enabledbooltrueWhether probe is enabled
opencost.exporter.startupProbe.failureThresholdint30Number of failures for probe to be considered failed
opencost.exporter.startupProbe.initialDelaySecondsint10Num

Deploy opencost with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has opencost on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartopencost is pinned at v2.5.35 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply