llm-wiki wiki · sources 2026-06-14

原文:raw/node-feature-discovery-architecture-analysis.md · 仓库:https://github.com/kubernetes-sigs/node-feature-discovery · 优先级 P1

一句话定位

Node Feature Discovery 发现 CPU、内核、PCI、NUMA、GPU/加速器等硬件/系统能力,并写成 node labels/features 供调度使用。

核心架构图

┌────────────────────────────────────────────────────────────────────────────┐
│ Node hardware and OS traits                                                │
│ CPU, GPU, PCI, kernel, NUMA, and custom device facts matter for            │
│ scheduling.                                                                │
└────────────────────────────────────────────────────────────────────────────┘
                                       │
                                       ▼
┌────────────────────────────────────────────────────────────────────────────┐
│ NFD workers and master/controller                                          │
│ Workers scan feature sources; master/controller publishes selected         │
│ features.                                                                  │
└────────────────────────────────────────────────────────────────────────────┘
                                       │
                                       ▼
┌────────────────────────────────────────────────────────────────────────────┐
│ Feature output                                                             │
│ Node labels, annotations, extended resource hints, and optional custom     │
│ rules.                                                                     │
└────────────────────────────────────────────────────────────────────────────┘
                                       │
                                       ▼
┌────────────────────────────────────────────────────────────────────────────┐
│ Consumers                                                                  │
│ Scheduler, device plugins, GPU operators, and AI workloads use the         │
│ discovered traits.                                                         │
└────────────────────────────────────────────────────────────────────────────┘

模块分层

层 / 模块 职责
nfd-worker node local feature sources
nfd-master/gc label publication and cleanup
Feature sources cpu, kernel, pci, usb, custom hooks
Rules custom feature labels

关键数据流

worker 扫描节点硬件和系统信息
        │
        ▼
生成 feature set
        │
        ▼
master 写 node labels/extended info
        │
        ▼
scheduler/operator 根据 labels 选择节点
        │
        ▼
变化时更新或清理

设计决策与哲学