---
title: "Stop wasting GPU allocation in Kubernetes with GPU-pruner"
description: "GPU-pruner addresses idle GPU allocation in Kubernetes by identifying workloads whose hardware activity remains below a configured threshold, rather than relying on browser sessions, network traffic, or pod lifetime. It queries Prometheus for NVIDIA Data Center GPU Manager metrics, including engine activity and GPU utilization, and treats peak performance below 1% throughout a default 35-minute observation window as idle. After tracing an idle pod through ownerReferences or KServe labels, it scales the parent resource to zero, preserving workload metadata for later restoration. Slack notifications, grace periods, lookback checks, and dry-run mode provide safeguards, while Prometheus label handling must preserve the workload namespace and pod identity in DCGM telemetry."
---

# Stop wasting GPU allocation in Kubernetes with GPU-pruner

[Red Hat](https://yomu.fyi/company/red-hat) · Fahim Uddin · Aug 31, 2026

**Type:** Problem & solution

## Summary

GPU-pruner addresses idle GPU allocation in Kubernetes by identifying workloads whose hardware activity remains below a configured threshold, rather than relying on browser sessions, network traffic, or pod lifetime. It queries Prometheus for NVIDIA Data Center GPU Manager metrics, including engine activity and GPU utilization, and treats peak performance below 1% throughout a default 35-minute observation window as idle. After tracing an idle pod through ownerReferences or KServe labels, it scales the parent resource to zero, preserving workload metadata for later restoration. Slack notifications, grace periods, lookback checks, and dry-run mode provide safeguards, while Prometheus label handling must preserve the workload namespace and pod identity in DCGM telemetry.

## Context

Kubernetes GPU workloads can remain allocated for days while showing almost no GPU engine activity, accumulating costs and blocking other users. Existing notebook and session cullers generally observe browser activity, requests, traffic, or pod lifetime rather than hardware utilization, so they can miss workloads that reserve GPUs without actively processing.

## Approach / What changed

GPU-pruner queries NVIDIA DCGM telemetry through Prometheus and applies a configurable inactivity threshold, defaulting to 1% peak engine performance over 35 minutes. It traces idle pods to parent Kubernetes or ML resources, optionally notifies owners through Slack, and scales those parents to zero instead of deleting them. Dry-run mode, lookback validation, grace periods, and Prometheus label configuration support safer deployment.

## Takeaways

- GPU-pruner monitors DCGM\_FI\_PROF\_GR\_ENGINE\_ACTIVE and DCGM\_FI\_DEV\_GPU\_UTIL through PromQL, using hardware telemetry to define inactivity.
- The controller follows ownerReferences or KServe-specific labels from an idle pod to resources such as Deployments, StatefulSets, Kubeflow Notebooks, and InferenceServices.
- Scaling the parent resource to zero preserves its configuration and metadata, allowing the workload to be restored by scaling it back up or using the platform UI.

**Tags:** [GPU](https://yomu.fyi/topic/gpu), [Kubernetes](https://yomu.fyi/topic/kubernetes), [Monitoring](https://yomu.fyi/topic/monitoring), [Prometheus](https://yomu.fyi/topic/prometheus)

- Source: [Red Hat](https://developers.redhat.com/articles/2026/08/31/stop-wasting-gpu-allocation-in-kubernetes-with-gpu-pruner)
- Source URL: https://developers.redhat.com/articles/2026/08/31/stop-wasting-gpu-allocation-in-kubernetes-with-gpu-pruner
- Ingested by Yomu: 2026-08-31T04:00:52.380Z

[Read original post](https://developers.redhat.com/articles/2026/08/31/stop-wasting-gpu-allocation-in-kubernetes-with-gpu-pruner)
