Skip to content

feat(k8s): kubernetes gpu hardware introspection and dynamic node labeling #124

Closed

Description

@dan-petty

Problem Statement

In local and homelab Kubernetes clusters (K3s/Minikube) running local AI stacks (Ollama, vLLM, Qdrant), pods targeting GPU acceleration require accurate node labeling for architecture, model, compute capability, allocatable GPUs, and VRAM sizing. Currently, devops-cli lacks commands to introspect GPU hardware, validate nvidia-container-toolkit CRI runtime availability, or automatically apply standardized Kubernetes node labels.

Proposed Changes

  • Implement devops k8s gpu status and devops k8s gpu label in src/devops_cli/commands/k8s/gpu.py.
  • Introspect GPU hardware using nvidia-smi (or Kubernetes Node API allocatable resources).
  • Parse architecture (pascal, ampere, hopper, blackwell), model names, compute capabilities, driver versions, and total VRAM.
  • Automatically apply standardized node labels (nvidia.com/gpu.present, nvidia.com/gpu.architecture, nvidia.com/gpu.model, nvidia.com/gpu.total-vram, nvidia.com/gpu.count).
  • Register FastMCP tool k8s_gpu_status and dynamic system resource resource://k8s/gpu/nodes.

Acceptance Criteria

  • Successfully detect and parse single and multi-GPU configurations without crashes.
  • Clean labeling of Kubernetes nodes matching cluster hardware.
  • Graceful degradation when nvidia-smi is absent (CPU nodes).
  • 100% test coverage in tests/test_k8s_gpu.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/k8stype/feature

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions