nvidia-gpu-exporter

by danchev

Helm chartv2.0.0App 2.0.0MITVerified publisher

Prometheus exporter for NVIDIA GPUs using NVML or nvidia-smi.

About this chart

nvidia-gpu-exporter

Prometheus exporter for NVIDIA GPUs using NVML or nvidia-smi.

Homepage: https://github.com/utkuozdemir/nvidia_gpu_exporter

TL;DR

$ helm repo add danchev https://danchev.github.io/helm-charts
$ helm install my-release danchev/nvidia-gpu-exporter

Upgrading to chart 2.0.0

This release runs NVIDIA GPU Exporter 2.0.0 and explicitly defaults to the NVML backend. Set collectBackend: exec to retain nvidia-smi collection. NVML exports nvidia_smi_nvml_return_code instead of nvidia_smi_command_exit_code; shared GPU metrics retain their names and labels.

The default node selector requires nvidia.com/gpu.present: "true". Ensure GPU nodes carry this label; override nodeSelector if your cluster uses another label. NVML exits at startup if the driver library is unavailable.

Default host library paths assume Debian/Ubuntu x86_64 GPU nodes. For SUSE/RHEL, set the volumes host paths to /usr/lib64/libnvidia-ml.so and /usr/lib64/libnvidia-ml.so.1, while retaining the container volumeMounts paths under /usr/lib/x86_64-linux-gnu/. Host paths and container paths need not match. Override the complete lists when changing volumes or volumeMounts.

The chart retains its existing privileged UID 0 security context for host-device access. The exporter image is shell-less. Custom nvidia-smi commands and fields outside the NVML catalog require collectBackend: exec.

Use extraArgs for additional exporter flags and extraEnv for container variables, for example:

collectBackend: nvml
extraArgs:
  - --collect.pcie-throughput
extraEnv:
  - name: LD_LIBRARY_PATH
    value: /usr/lib/x86_64-linux-gnu

Values

KeyTypeDefaultDescription
affinityobject{}Affinity for the pod assignment
collectBackendstring"nvml"Collection backend: nvml (direct driver access) or exec (nvidia-smi).
extraArgslist[]Additional exporter command-line arguments.
extraEnvlist[]Additional container environment variables, including valueFrom references.
fullnameOverridestring""String to fully override fullname template with a string
hostNetworkboolfalse
hostPort.enabledboolfalseEnable hostPort
hostPort.portint9835The hostPort to listen to
image.pullPolicystring"IfNotPresent"Image pull policy
image.repositorystring"ghcr.io/utkuozdemir/nvidia_gpu_exporter"Image repository
image.tagstring""Image tag (if not specified, defaults to the chart's appVersion)
imagePullSecretslist[]Image pull secrets
ingress.annotationsobject{}Annotations for the Ingress
ingress.classNamestring""Ingress class name
ingress.enabledboolfalseexposing the metrics of the GPU on the node it is on
ingress.hostslist[{"host":"chart-example.local","paths":[{"path":"/","pathType":"ImplementationSpecific"}]}]Ingress hosts configuration
ingress.tlslist[]The TLS configuration for the Ingress
log.formatstring"logfmt"Log format to be used by the exporter
log.levelstring"info"Log level to be used by the exporter
nameOverridestring""String to partially override fullname template with a string (will prepend the release name)
nodeSelectorobject{"nvidia.com/gpu.present":"true"}The node selector for the deployment
nvidiaSmiCommandstring"nvidia-smi"The command to run to get nvidia-smi compatible output. Can be custom path and/or args.
podAnnotationsobject{}Annotations for the pods
podSecurityContextobject{}Security context for the pods
portint9835Port for the exporter to listen to
queryFieldNameslist["AUTO"]Query fields to be collected by the exporter
resourcesobject{}The resource requests and limits of the container
securityContextobject{"privileged":true,"runAsUser":0}Security context for the container. Privileged is required for the collector to work properly.
service.enabledbooltrueEnables the Service
service.nodePortstringnilThe node port to use if service type is NodePort or LoadBalancer.
service.portint9835Port for the service to use
service.typestring"ClusterIP"Type of the service
serviceAccount.annotationsobject{}Annotations to add to the service account
serviceAccount.createbooltrueSpecifies whether a service account should be created
serviceAccount.namestring""The name of the service account to use. If not set and create is true, a name is generated using the fullname template
serviceMonitorobjectsee values.yamlPrometheus PodMonitor configuration
telemetryPathstring"/metrics"The path to expose the metrics from
tolerationslist[]Tolerations for the pod assignment
volumeMountslistsee values.yamlThe container mount configurations for the volumes
volumeslistsee values.yamlThe volumes to mount from the host

Maintainers

NameEmailUrl
Dobri Danchev[email protected]https://danchev.github.io/helm-charts/

Source Code

Attribution

This chart is derived from Utku Özdemir's Helm charts. The NVIDIA GPU Exporter is an upstream project by Utku Özdemir.

Deploy nvidia-gpu-exporter with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has nvidia-gpu-exporter 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 chartnvidia-gpu-exporter is pinned at v2.0.0 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