Skip to content

fix(k8s): stop telling a person to label a GPU node #7437

Done

Description

@dan-petty

Problem

The GPU placement warning of devops k8s deploy-stack tells a person to label a node by hand. gpu_node_without_total and gpu_node_total_not_accepted (src/devops_cli/lang/en/messages.py) print kubectl label node <node> nvidia.com/gpu.total-vram-gib=<N>Gi.

On the homelab, Node Feature Discovery now sets nvidia.com/gpu.total-vram-gib and nvidia.com/gpu.architecture from a NodeFeatureRule of Application nvidia-device-plugin (dan-petty/homelab#551, pull request 569). NFD writes the value of the rule again, so a label set by hand does not last. The fix for a total that no tier lists is a change of the tier list in llm/profiles/ollama-profiles.yaml.

The same rule copies GPU Feature Discovery's nvidia.com/gpu.family into nvidia.com/gpu.architecture only because CONST_K8S_GPU_ARCHITECTURE_LABEL names that key (_newest_architecture in src/devops_cli/k8s/gpu_thresholds.py, gpu_placement.py). GFD's family names are the names of CONST_K8S_GPU_ARCHITECTURES.

Change

  • Make the two warnings name the tier list in git, not a kubectl label command.
  • Optional: read nvidia.com/gpu.family, so the environment can drop the copied label.

Done when

  • No message of deploy-stack tells a person to set a GPU label by hand.

Source

Source: https://github.com/dan-petty/homelab/issues/551

Alternatives check of 2026-11-27: none.
Tool: none found.
Reason: Searches returned only NVIDIA device-plugin and GPU-operator images, none of which changes a project's own warning text; the need is an edit of two message strings plus optionally reading an existing NFD label, so no external tool covers it.

Lacks:

  • No tool rewrites the project's own warning messages
  • Node label sources are already NFD rules in the homelab repo
  • Tier list edit in ollama-profiles.yaml is project-specific

Proposed design

Problem statement

The GPU placement warnings of devops k8s deploy-stack tell a person to set a node label by hand. Node Feature Discovery writes that label again from a NodeFeatureRule, so a hand-set label does not last. The two warnings must name the GPU tier list in git instead of a kubectl label node command. The optional read of the GPU family label is a separate part and is deferred.

Acceptance criteria

Requirement: GPU node without total names the tier list

The gpu_node_without_total warning SHALL name llm/profiles/ollama-profiles.yaml as the place to add a GPU tier.

Scenario: Warning for a node with no GPU total

  • WHEN The test at tests/commands/k8s/test_k8s_gpu_placement.py formats gpu_node_without_total for a node with no nvidia.com/gpu.total-vram-gib label.
  • THEN The formatted text holds llm/profiles/ollama-profiles.yaml and holds no kubectl label node.

Requirement: GPU node total not accepted names the tier list

The gpu_node_total_not_accepted warning SHALL name llm/profiles/ollama-profiles.yaml as the place to change the GPU tier list.

Scenario: Warning for a GPU total that no tier lists

  • WHEN The test at tests/commands/k8s/test_k8s_gpu_placement.py formats gpu_node_total_not_accepted for a node whose total is not in the tier list.
  • THEN The formatted text holds llm/profiles/ollama-profiles.yaml and holds no kubectl label node.

Requirement: GPU placement warnings hold no manual label command

Every GPU placement warning of devops k8s deploy-stack MUST NOT hold the text kubectl label node.

Scenario: GPU placement warning catalog

  • WHEN The test at tests/commands/k8s/test_k8s_gpu_placement.py formats each attribute of the module src/devops_cli/lang/en/messages.py whose name starts with gpu_node_.
  • THEN No formatted attribute holds kubectl label node.

Existing Tool Considered

The alternatives check of 2026-11-27 in the issue body gives the verdict none and names no tool. It holds what no tool covers. No open, maintained tool or library covers the need, because no tool rewrites the warning text of the project itself. The change edits two strings in src/devops_cli/lang/en/messages.py. The written cost to build, keep and fix that code until a tool matches it is about 5,000 tokens and 45 minutes.

Key questions

  • Where do the two GPU placement warnings live, and which module formats them?: gpu_node_without_total is at src/devops_cli/lang/en/messages.py:926. gpu_node_total_not_accepted is at src/devops_cli/lang/en/messages.py:930. The module src/devops_cli/k8s/gpu_placement.py formats both for the placement report. [sources: src/devops_cli/lang/en/messages.py:926, src/devops_cli/lang/en/messages.py:930, src/devops_cli/k8s/gpu_placement.py]
  • Which source should the two GPU placement warnings name for a GPU total that no tier lists?: The warnings name the GPU tier list llm/profiles/ollama-profiles.yaml. A person adds or changes the tier there. The warning holds no kubectl label node command. (best practice) [sources: src/devops_cli/lang/en/messages.py:926, src/devops_cli/lang/en/messages.py:930]
    • Chosen: Name the tier list in git. Node Feature Discovery writes the GPU labels again from a NodeFeatureRule, so a hand-set label does not last. The tier list is the durable source.
    • Rejected: Keep the kubectl label node command. The NodeFeatureRule of the homelab writes the label again. The command tells a person to do work that does not last.
    • Rejected: Name no path and point at the environment tier list. The body asks the warnings to name the tier list. A path is actionable and a test can check it.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Moved to new items

#7640

Activity

  1. added
    type/bug
    scope/k8s
    source/agent
    status/new
    value/medium
    effort/low
    on Nov 27, 2026
  2. dan-petty commented on Nov 27, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 27, 2026
  4. devops-cli-service commented on Nov 27, 2026

    @devops-cli-service
    Contributor

    The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.

    Searches (7)

    Searches run:

    • NVIDIA GPU Feature Discovery nvidia.com/gpu.family label node, results: 5
    • Node Feature Discovery NodeFeatureRule set GPU VRAM label automatically, results: 5
    • "gpu.family" label kubernetes nvidia device plugin, results: 5
    • kubernetes-nmstate OR nfd node feature discovery node labels gitops instead of kubectl label, results: 5
    • nvidia gpu operator node labeling, results: 5
    • kubectl label node GPU VRAM gpu-labeler tool, results: 5
    • NVIDIA k8s-device-plugin gpu-feature-discovery repository, results: 5
  5. added
    status/ready
    and removed
    status/new
    on Nov 28, 2026
  6. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See the section Proposed design of the body.

  7. dan-petty commented on Nov 28, 2026

    @dan-petty
    OwnerAuthor

    Returned to New per Rule 2 (cannot be built as specified):

    The refined acceptance criteria for the optional nvidia.com/gpu.family fallback require passing a node label map (nvidia.com/gpu.family / nvidia.com/gpu.architecture) directly to _newest_architecture in tests/commands/k8s/test_k8s_gpu_placement.py and returning the architecture/family string from that map.

    In the codebase:

    1. _newest_architecture(template: dict[str, Any]) -> str lives in src/devops_cli/k8s/gpu_thresholds.py:116, takes a DaemonSet manifest template (reading spec.template.spec.affinity.nodeAffinity.requiredDuringSchedulingIgnoredDuringExecution.nodeSelectorTerms), and returns the newest accepted architecture value across matchExpressions.
    2. src/devops_cli/k8s/gpu_placement.py has no _newest_architecture function and evaluates DaemonSet matchExpressions verbatim against node labels (accepts); treating nvidia.com/gpu.family as satisfying a nvidia.com/gpu.architecture selector would misreport Kubernetes scheduling while manifests still require nvidia.com/gpu.architecture.

    The warning message updates (gpu_node_without_total and gpu_node_total_not_accepted in src/devops_cli/lang/en/messages.py) are ready to implement once the optional nvidia.com/gpu.family criteria are scoped against the real gpu_thresholds._newest_architecture(template) / gpu_placement signatures (or dropped to keep only the warning fix).

  8. added
    status/new
    and removed
    status/ready
    on Nov 28, 2026
  9. added
    status/ready
    and removed
    status/new
    on Nov 28, 2026
  10. devops-cli-service commented on Nov 28, 2026

    @devops-cli-service
    Contributor

    Next step: the stage job writes the plan of the item. See Moved to new items in the section Proposed design of the body.

  11. added
    owner/agent
    status/in-progress
    status/in-review
    and removed
    status/ready
    status/in-progress
    on Nov 29, 2026
  12. removed
    status/in-review
    owner/agent
    on Nov 29, 2026
  13. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-29 03:13 UTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/lowpriority/p2-mediumscope/k8ssource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions