, ,

How to manage the GPU node lifecycle in Kubernetes

How a GPU node joins a Kubernetes cluster, gets upgraded, gets repaired after a hardware fault and is retired, without killing long training jobs. With a live demo of every step.

How to manage the GPU node lifecycle in Kubernetes: a ring of six stages from join to retire, with Repair highlighted

AI infrastructure · Kubernetes · NVIDIA GPU Operator · Day-2 operations

Monitoring tells you a GPU node has a problem. Logs tell you why. This post is about what you do next: how a GPU node joins the cluster, gets upgraded, gets repaired after a hardware fault and finally leaves, without killing a training job that has been running for three days. There is a live demo where you can run every one of these operations and watch each step.

Part 1MonitoringIs the GPU busy, hot or broken? Part 2LoggingWhy did it break?
Part 3 · this postLifecycleWhat do we do about it?
Try it: GPU Node Lifecycle

A simulated cluster of four H100 nodes with real workloads. Run a rolling driver upgrade, repair a node after an Xid error, switch a node to MIG, add a node and retire one. Every cordon, drain and GPU Operator label is shown as it happens.

Open the demo →

The differenceWhy GPU nodes are harder than CPU nodes

The Kubernetes tools are the same: cordon, drain, uncordon. What changes is the cost of getting them wrong.

Typical CPU node
GPU node
Draining
Web pods move in seconds. Nobody notices.
A 4-GPU training job may need to checkpoint first, and needs four free GPUs on one node to restart.
Drivers
Part of the OS image. Rarely touched.
A kernel module that must match the CUDA libraries. A half-finished upgrade breaks every GPU tool on the node.
Failures
Usually the whole node, rarely.
One card at a time: Xid errors, ECC errors, NVLink faults. The node is up but a GPU is not.
Cost of idle time
A few cents an hour.
At $2 to $4 per H100 hour, an 8-GPU node sitting cordoned costs $16 to $32 every hour.

The mapSix stages of a GPU node

Every GPU node goes round the same loop. Most of its life is spent in Ready. Every maintenance task, planned or not, goes through the same three moves: cordon, drain, validate.

1 · Joindriver, labels 2 · Validatedcgmi diag, NCCL 3 · Readyrunning jobs 4 · Maintaincordon, drain, upgrade 5 · RepairXid, ECC, RMA 6 · Retiredrain, delete, wipe PLANNED BACK TO VALIDATE FAULT FIXED, RE-VALIDATE cannot fix

A repaired or upgraded node never goes straight back to Ready. It goes through validation first, the same checks a brand new node gets.

1Join

The machine joins the cluster. The GPU Operator installs the driver, device plugin and DCGM exporter, and labels the node with its GPU model and count.

Done when: nvidia.com/gpu.present=true and allocatable GPUs appear.
2Validate

Prove the hardware before any real job lands. Run DCGM diagnostics on each GPU and an NCCL all-reduce test across GPUs and nodes.

Done when: diagnostics pass and bandwidth matches the other nodes.
3Ready

Uncordoned and running work. Monitoring and logging, from parts 1 and 2, watch it all the time.

Stays here until: a planned change or a fault.
4Maintain

Driver, firmware, OS or MIG changes. Cordon, drain without breaking jobs, change, then validate again.

Done when: validation passes and the node is uncordoned.
5Repair

A GPU fault. Cordon at once, drain, reset or reboot, run long diagnostics. If they fail, raise a hardware ticket.

Done when: the card passes long diagnostics, then normal validation.
6Retire

End of life or end of lease. Drain, remove from the cluster, and wipe local disks that held model weights or data.

Done when: the node is out of Kubernetes, monitoring and inventory.

Stage 1 and 2Joining and validating a new node

With the GPU Operator installed, a new node needs almost no manual work. The operator sees an NVIDIA device and rolls out its pods. GPU Feature Discovery then adds labels such as nvidia.com/gpu.product, nvidia.com/gpu.count, nvidia.com/gpu.memory and nvidia.com/cuda.driver.major. Jobs can use these labels to pick the right hardware.

What the operator does not do is prove the hardware is good. A new node can join with a weak GPU, a bad cable or a slow NVLink, and pass every Kubernetes check. So keep new nodes away from real work until they pass a burn-in:

# keep the node out of the pool while you test it
kubectl cordon gpu-node-e

# long DCGM diagnostics on every GPU (run in a privileged pod or on the host)
dcgmi diag -r 3

# bandwidth between all GPUs on the node, compare with your other nodes
all_reduce_perf -b 8 -e 8G -f 2 -g 8

# only now open it for work
kubectl uncordon gpu-node-e
Tip. Many teams also taint GPU nodes, for example nvidia.com/gpu=present:NoSchedule, so ordinary CPU pods never take up space on an expensive machine. Only pods that tolerate the taint and ask for nvidia.com/gpu land there.

Stage 4Upgrading drivers without breaking jobs

Driver upgrades are the maintenance task you will do most often. The GPU Operator has an upgrade controller that does them one node at a time. You change the driver version in its ClusterPolicy, and the controller walks each node through a series of states, recorded in a node label:

upgrade-requiredcordon-requiredwait-for-jobs-requiredpod-deletion-requireddrain-requiredpod-restart-requiredvalidation-requireduncordon-requiredupgrade-doneupgrade-failed

Watch it live with kubectl get nodes -L nvidia.com/gpu-driver-upgrade-state. If a node shows upgrade-failed, it stays cordoned until you look at it.

The settings that matter sit under driver.upgradePolicy:

apiVersion: nvidia.com/v1
kind: ClusterPolicy
metadata:
  name: cluster-policy
spec:
  driver:
    version: "575.57.08"
    upgradePolicy:
      autoUpgrade: true
      maxParallelUpgrades: 1        # one node at a time
      maxUnavailable: 25%
      waitForCompletion:
        podSelector: "app=llama-finetune"   # let these jobs finish first
        timeoutSeconds: 3600
      drain:
        enable: true
        force: false
        timeoutSeconds: 600
        deleteEmptyDir: true

Firmware, OS patches and MIG changes follow the same loop: cordon, drain, change, reboot if needed, validate, uncordon. For MIG, you set a label such as nvidia.com/mig.config=all-1g.10gb and the MIG manager does the rest. Remember that a MIG node stops offering nvidia.com/gpu and offers MIG slices instead, so pods asking for whole GPUs will no longer fit there.

Make your workloads safe to drain

The upgrade controller can only be as gentle as your workloads allow. Three settings decide whether a drain is a non-event or an outage.

InferencePodDisruptionBudget

Stops a drain from removing the last running replica. The drain waits until a replacement is up somewhere else.

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: vllm-chat
spec:
  minAvailable: 1
  selector:
    matchLabels:
      app: vllm-chat
InferenceSpread the replicas

Without this, the scheduler may pack both replicas onto one node, and draining that node takes out both. The demo shows this happening.

topologySpreadConstraints:
- maxSkew: 1
  topologyKey: kubernetes.io/hostname
  whenUnsatisfiable: DoNotSchedule
  labelSelector:
    matchLabels:
      app: vllm-chat
TrainingCheckpoint on SIGTERM

A drain sends SIGTERM. Catch it, save a checkpoint, exit. Give the pod enough grace time to finish writing.

spec:
  terminationGracePeriodSeconds: 600
  containers:
  - name: trainer
    # train.py saves a checkpoint
    # when it receives SIGTERM

Stage 5Repairing a node after a GPU fault

When a GPU fails, the device plugin removes it from the node’s allocatable count, but the node itself stays Ready. Other GPUs on it keep taking new work, and a sick node keeps failing jobs. The fix is a short, fixed routine.

DETECT
An alert fires

DCGM_FI_DEV_XID_ERRORS > 0 from part 1, or the NVRM: Xid log line from part 2.

STOP
Cordon at once

kubectl cordon. No new jobs land on a node you are about to work on. This can be automated: Node Problem Detector or a small controller can cordon on the alert.

EMPTY
Drain gently

Same drain as an upgrade, so checkpoints and disruption budgets still apply.

RESET
Reset the GPU or reboot the node

Many faults, including some Xid 79 cases, clear after a reboot.

TEST
Run long diagnostics

dcgmi diag -r 3, not the quick level.

PassValidate like a new node, then uncordon. Keep an eye on it for a week: a fault that comes back means the card is failing.
FailOpen a hardware ticket with the Xid code, GPU serial and diagnostics output. Leave the node cordoned until the card is replaced, then validate again.
Count faults per GPU, not per node. Track Xid errors by GPU serial number over time. A card that throws two Xid 79s in a month should be replaced, even if each one cleared after a reboot.

Stage 6Retiring a node

  1. Cordon and drain

    Exactly as for maintenance, so running jobs checkpoint and services keep their replicas.

  2. Delete the node from Kubernetes

    kubectl delete node gpu-node-c, then remove the machine from its node pool or autoscaler so it is not added back.

  3. Wipe local disks

    GPU nodes often cache model weights, datasets and sometimes tokens on local NVMe for speed. Wipe them before the machine is returned, resold or recycled.

  4. Clean up everything that knew about it

    Monitoring targets, alert silences, inventory, the hardware ticket history, and your capacity plan. Fewer GPUs means some jobs that fit last month may now wait in the queue.

Before you call it done
  • New nodes stay cordoned until DCGM diagnostics and an NCCL test pass.
  • Driver upgrades go through the GPU Operator one node at a time, never by hand on a live node.
  • Every inference service has a PodDisruptionBudget and spreads its replicas across nodes.
  • Training jobs save a checkpoint on SIGTERM and have enough grace time to finish writing it.
  • A GPU fault cordons the node automatically, not when someone notices.
  • Xid errors are tracked per GPU serial, so repeat offenders get replaced.
  • Retired nodes have their local disks wiped.
Run it yourself

Open GPU Node Lifecycle, start a rolling driver upgrade, then break a GPU on another node while it runs. Watch the upgrade controller wait, the disruption budget block an eviction and the training job resume from its checkpoint.

Open the demo →

The full series: How to monitor GPUs in Kubernetes, How to read GPU logs in Kubernetes and this post. Hands-on practice: the AI Infrastructure Lab Workbook.

About The Author


Discover more from Journal of Intelligent Infrastructure

Subscribe to get the latest posts sent to your email.

Next Post

Leave a Reply

Your email address will not be published. Required fields are marked *

Architect’s Toolkit

About the Author

Dr. Pranay Jha is a Cloud and AI Consultant with 18+ years of experience in hybrid cloud, virtualization, and enterprise infrastructure transformation. He specializes in VMware technologies, multi-cloud strategy, and Generative AI solutions. He holds a PhD in Computer Applications with research focused on Cloud and AI, has published multiple research papers, and has been a VMware vExpert since 2016 and a VMUG Community Leader.

Discover more from Journal of Intelligent Infrastructure

Subscribe now to keep reading and get access to the full archive.

Continue reading