llm-wiki wiki · sources 2026-06-14

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

一句话定位

KWOK 是 Kubernetes WithOut Kubelet,用 fake nodes/pods 模拟大规模集群,适合调度、控制器和 scalability 测试。

核心架构图

┌────────────────────────────────────────────────────────────────────────────┐
│ Large-cluster simulation need                                              │
│ Tests need many nodes or workloads without running kubelets.               │
└────────────────────────────────────────────────────────────────────────────┘
                                       │
                                       ▼
┌────────────────────────────────────────────────────────────────────────────┐
│ KWOK controller                                                            │
│ Watches fake nodes and pods and drives lifecycle/status transitions.       │
└────────────────────────────────────────────────────────────────────────────┘
                                       │
                                       ▼
┌────────────────────────────────────────────────────────────────────────────┐
│ Stage configuration                                                        │
│ Rules define how objects move through simulated phases and conditions.     │
└────────────────────────────────────────────────────────────────────────────┘
                                       │
                                       ▼
┌────────────────────────────────────────────────────────────────────────────┐
│ Output                                                                     │
│ Kubernetes API server sees scalable simulated nodes, pods, and status for  │
│ control-plane tests.                                                       │
└────────────────────────────────────────────────────────────────────────────┘

模块分层

层 / 模块 职责
kwok controller fake kubelet behavior
kwokctl cluster lifecycle
Stage/Configuration pod/node condition transitions
Integrations kind/kube-apiserver tests

关键数据流

创建 KWOK cluster 或接入现有 apiserver
        │
        ▼
声明大量 fake nodes/pods
        │
        ▼
kwok controller 模拟状态变化
        │
        ▼
被测 scheduler/controller 观察大规模对象
        │
        ▼
收集性能和行为结果

设计决策与哲学