← All posts

Nothing hands a GPU back on its own

A vast empty hall traced in glowing cyan circuit lines, every ceiling light panel blazing white over nobody, and one small magenta occupancy sensor glowing on the far wall, right of centre.

This is my homelab: single-node Kubernetes clusters on Talos, one operator, and a few GPUs that each carry more than one workload. Nothing here describes an employer's systems. The incident is from my notes of 3 August 2026, on a machine that has been powered off by choice since September; what Kubernetes and Argo CD do is their documented behaviour, checked against my own config.

When git says replicas: 0 and Argo CD says Synced, the server is off and its GPU slot is free. On 3 August, the day that machine came back on after most of July off, mine was awake, holding one of four slots on an RTX 5080, its hostname pointing at another machine. That day the same card was carrying the lab's live LLM backend. Nothing flagged it; I found it only because I went looking for room on the card.

Scale-to-zero is an occupancy sensor: a request switches the light on, and thirty quiet minutes switch it off. A request had switched this server's light on, and the sensor never switched it off.

Git declares zero and Argo CD stops comparing; the woken pod holds one of four GPU slots until it ends, and only holders read against git and the timeout show it

Lend the switch to the sensor, and git stops counting

The server was Emby, a Sablier scale-to-zero Deployment: zero replicas in git, woken by the first request through the cluster's ingress proxy. The first wiring never came up. Argo CD's self-heal saw the wake as drift and reverted it within about a second. The fix lent the replica count to the sensor:

# trimmed from the Argo CD Application that deployed Emby
spec:
  ignoreDifferences:
    - group: apps
      kind: Deployment
      name: emby
      namespace: media
      jsonPointers:
        - /spec/replicas
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true
      - RespectIgnoreDifferences=true
# result: the replica count leaves the diff, and no sync writes git's value back over the scaler's

ignoreDifferences takes /spec/replicas out of the comparison, so self-heal sees no drift to revert. RespectIgnoreDifferences carries the exclusion into the sync, so a sync for an unrelated change does not reapply git's number. That is Argo CD's documented behaviour, so while the Deployment exists, the reconciler never applies the declared zero. Any scale-down the sensor did not make was mine to do, and replicas: 0 recorded what I wanted and enforced nothing.

So git reports the light off whatever it is doing, and Argo CD reads Synced either way. That was the right call: without it, scale-to-zero does not work.

Kubernetes leaves the light on until the pod ends

Time-slicing made that 5080 advertise four nvidia.com/gpu slots, budgeted one each for two media servers, the transcode node and the model server. By August the other media server had moved elsewhere, leaving one spare. A slot is a scheduling handle, not a fence: time-slicing puts no memory or fault isolation between the four. Each one is counted once its pod is scheduled, and the device plugin is asked for a device at container creation. The kubelet hands it back only when the pod ends, and nothing in that path looks at whether the pod is using it.

Emby's slot was its own, as budgeted, so the scheduler had no complaint. Scale-to-zero was the only thing whose job was to end an idle pod. Why it never ended this one is not in my notes.

On 3 August, raising that card's transcode workers from two to four, I went through everything on it. With a slot spare, and those workers inside one pod's slot, the awake server kept no slot from anyone, so the price was small. What it shared was the card: an unrouted server sat beside the model server behind the lab's model gateway with no fence between them, and no record I kept separates its memory or encoder use from the card's. On a card that is not time-sliced, the plugin hands its one unit to exactly one pod, and the same light left on holds all of it.

Ask the allocator who holds the slot

Neither git nor the cluster alone could have told me: a holder list shows Emby in its budgeted slot like a server someone is streaming from, and git says zero either way. The giveaway is the comparison the reconciler dropped, bounded by the scale-to-zero controller's own timeout. Ask the ledger the scheduler sums and read each answer against git:

kubectl get pods -A --field-selector=status.phase!=Succeeded,status.phase!=Failed -o json \
  | jq -r '.items[]
      | select(.spec.nodeName != null)
      | select([(.spec.initContainers // [])[], .spec.containers[]
                | .resources.limits["nvidia.com/gpu"] // empty] | length > 0)
      | "\(.spec.nodeName)\t\(.metadata.namespace)/\(.metadata.name)"'
# one line per scheduled pod holding a slot; one git declares at zero is a candidate, and idle past the controller's timeout it is a light left on

A diff of the lent field flags this one too; the holder list also finds ones git never declared. In late October 2026 I ran it against another lab cluster with its own GPU resource name. It named every pod holding a slot, and with each pod's limit added, the total matched kubectl describe node.

Switching it off took a scale to zero by hand and no commit, since git already said zero. Argo CD stayed Synced and Healthy. It was the second time. On 2 July I had made the same scale while media moved to another machine, and a request after that woke it again. A hand scale switches the light off once. It does not touch the sensor that left it on.

Put the comparison back where it is scarce

Every field you lend to another controller leaves the reconciler's comparison, so drift in it is invisible by design. For most fields that loss is cheap. For each lent field that decides who holds an accelerator, put the comparison back: what holds the slot now, against what git says should. A holder git declares at zero, idle for longer than the controller's own timeout, is the controller failing, not a guest. The cluster knows what it has handed out and the repository knows what you meant; the drift lives in the gap between them.

Lend the switch to a sensor. Count the lights yourself.

From the lab, 3 August 2026: a 5080 time-sliced four ways, one slot held by a server git declared at zero. That machine and its scale-to-zero controller are dormant now, and the holder check has only been run by hand, on another cluster.

Read next