How kubernetes-sigs/kwok works
Project type and purpose
• This is a full‑stack CLI + simulator toolkit for Kubernetes (“KWOK” = Kubernetes WithOut Kubelet).
• Purpose: simulate large Kubernetes clusters (thousands of nodes/pods) with minimal resources for testing, benchmarking, and development.
File structure
• Top‐level executables:
• cmd/kwok → “kwok” server binary (implements API server + controllers)
• cmd/kwokctl → “kwokctl” CLI (cluster orchestration)
• API & controllers:
• pkg/apis → CRD definitions for Nodes, Pods, Stages, Metrics, etc.
• pkg/client → generated clientsets for those CRDs
• pkg/kwok/server → custom API server code
• pkg/kwok/controllers → reconciliation loops (NodeController, PodController, StageController, etc.)
• pkg/kwok/metrics → metrics gathering & export
• Orchestration & runtime:
• pkg/kwokctl/{cmd,components,etcd,k8s,pki,recording,runtime,scale,snapshot} → CLI commands + helpers to launch etcd, API server, controller manager, scheduler, metrics server, dashboards, etc., via container runtimes (docker, nerdctl, kind, compose, binary)
• Deployment templates:
• charts/… → Helm charts
• kustomize/… → Kustomize overlays for CRDs and components
• images/… → Dockerfiles for cluster and kwok images
• Tests & demos: hack/, test/, demo/ → integration & e2e tests, demonstration scripts, sample manifests
README for additional insights
• “kwok” simulates lifecycles of fake nodes/pods via CRDs & controllers
• “kwokctl” simplifies cluster creation & management by orchestrating control‑plane components in containers or processes
• Compatibility with any Kubernetes client (kubectl, helm, etc.) and standard Kubernetes APIs
Don’t overthink—be comprehensive
• Break the system into as many logical components as it has: CLI, runtime, CRDs, API server, controllers, metrics, storage, external clients.
• Every essential architectural element, even optional ones (e.g., various runtime backends, chart templates).