[Feature]: Support affinity / nodeSelector for operand DaemonSets in ClusterPolicy spec.daemonsets

Đang mở
#2,626 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

  • #2645 của @amarkdotdev — đã đóng, không merge

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
go, helm, kubernetes
Lĩnh vực
devops, infrastructure

Hướng nghiên cứu

Bắt đầu từ API ClusterPolicy spec.daemonsets và các giá trị daemonsets của Helm, sau đó theo dõi cách cấu hình DaemonSet chung được truyền tới từng operand được liệt kê. Xác minh rằng các giá trị mặc định rỗng vẫn giữ nguyên hành vi hiện tại và affinity cùng nodeSelector được cấu hình được áp dụng cho tất cả DaemonSet của operand cùng với lựa chọn NFD hiện có. Hoàn tất khi API và chart cung cấp cả hai trường và hành vi được bao phủ trên tất cả operand.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

lifecycle/stale

Feature description

Add affinity and nodeSelector to the common DaemonSet config in ClusterPolicy
(spec.daemonsets), surfaced in the Helm chart as daemonsets.affinity /
daemonsets.nodeSelector (default empty). When set, apply them to all operand
DaemonSets (driver, container-toolkit, device-plugin, dcgm-exporter, gfd,
mig-manager, …), on top of the operator's existing NFD-based node selection.

Motivation

spec.daemonsets already exposes tolerations but has no affinity/nodeSelector.
That's an asymmetry: tolerations only permit scheduling onto tainted nodes — they
can't restrict where operands land. On a cloud cluster (EKS/GKE/AKS) with several
autoscaled node pools where only one has GPUs, I want to declaratively pin operands to
that pool via a label it already carries (e.g. karpenter.sh/nodepool=gpu).

The documented alternatives don't cover this well:

  • nvidia.com/gpu.deploy.<operand>=disabled labels / node taints (how #547 was
    closed) are subtractive: you must label or taint every node you want to exclude.
    In autoscaled clusters (Karpenter, managed nodegroups) where nodes churn constantly,
    that doesn't scale and is race-prone.
  • NFD gating keeps operands off non-GPU nodes, but can't target a specific GPU
    pool and doesn't apply when NFD is disabled.

A first-class affinity/nodeSelector is declarative, applies automatically to new
nodes, and is consistent with the operator's own NvidiaDriver CRD, which already
exposes spec.affinity and spec.nodeSelector.

Prior art

#547 requested essentially this and was closed pointing at the subtractive workarounds
above; a community MR to add nodeSelector to the common daemonset config was referenced
there but never landed.

Proposed API

# ClusterPolicy
spec:
  daemonsets:
    nodeSelector:            # proposed
      karpenter.sh/nodepool: gpu
    affinity: {}             # proposed
# Helm values.yaml
daemonsets:
  affinity: {}       # default: unchanged behavior
  nodeSelector: {}   # default: unchanged behavior

User-supplied values should be merged (AND) with the operator's NFD-based selection so
GPU detection still applies.

Ngôn ngữ chính
Go
Star
3k
Fork
592
Merge trung bình
3 ngày 16 giờ
Pull request đã merge (30 ngày)
68

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của NVIDIA/gpu-operator

Tất cả issue của NVIDIA/gpu-operator

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.