llm-wiki wiki · sources 2026-06-14

原文:raw/kueue-architecture-analysis.md · 仓库:https://github.com/kubernetes-sigs/kueue · 优先级 P0

一句话定位

Kubernetes-native Job Queueing,用 ClusterQueue/LocalQueue/Workload/ResourceFlavor 把 batch、AI/HPC 和多租户资源配额做成 admission control。

核心架构图

┌────────────────────────────────────────────────────────────────────────────┐
│ Batch / AI / HPC workload intent                                           │
│ Users submit Jobs, JobSets, RayJobs, MPIJobs, or PyTorchJobs.              │
└────────────────────────────────────────────────────────────────────────────┘
                                       │
                                       ▼
┌────────────────────────────────────────────────────────────────────────────┐
│ Kueue APIs                                                                 │
│ ClusterQueue, LocalQueue, Workload, and ResourceFlavor model quota and     │
│ admission.                                                                 │
└────────────────────────────────────────────────────────────────────────────┘
                                       │
                                       ▼
┌────────────────────────────────────────────────────────────────────────────┐
│ Admission and quota control                                                │
│ Workload admission, cohort borrowing, fair sharing, flavor assignment, and │
│ preemption.                                                                │
└────────────────────────────────────────────────────────────────────────────┘
                                       │
                                       ▼
┌────────────────────────────────────────────────────────────────────────────┐
│ Runtime boundary                                                           │
│ Admitted workloads flow to Kubernetes scheduler and normal cluster         │
│ runtime.                                                                   │
└────────────────────────────────────────────────────────────────────────────┘

模块分层

层 / 模块 职责
API ClusterQueue / LocalQueue / Workload / ResourceFlavor
Controller workload admission, quota accounting, preemption
Integrations Job, JobSet, RayJob, MPIJob, PyTorchJob 等 batch workload
Scheduler-like logic cohort borrowing、fair sharing、flavor assignment

关键数据流

用户提交 Job/JobSet/RayJob
        │
        ▼
Kueue 为 workload 建队列对象
        │
        ▼
ClusterQueue 检查资源配额与 flavor
        │
        ▼
admit 后 workload 才真正消耗集群资源
        │
        ▼
完成/失败后释放 quota

设计决策与哲学