AI/LLM on Kubernetes Infrastructure¶
This documentation is not about "how to get a GPU Pod running", but about how to build Kubernetes into a sustainable, evolving AI/LLM infrastructure: devices can be discovered and isolated, jobs can queue fairly, data can keep up with compute, training can recover, inference can meet latency targets, models and dependencies can be traced, and the platform can be upgraded, observed and audited.
The content covers the complete chain from hardware to applications, and attempts to answer four types of questions: what each component is responsible for, when it is needed, how to verify it, and where to troubleshoot when problems arise.
Browse by Topic View Reference Architecture Run GPU Platform Experiments Go to Hands-On and Troubleshooting
Infrastructure Overview¶
English rendering — the original text is retained below.
Users, SDKs, applications, and workflows
│
├─ Big data / RAG / Agent / Online inference / Training tasks
│
Gateway, Serving, Trainer, Pipeline, Queue
│
Kubernetes API, controllers, scheduler, admission and policies
│
Device Plugin / CDI / DRA / CNI / CSI / CRI
│
GPU, TPU, NPU, CPU, RDMA, NVMe, object storage
│
Power, cooling, racks, failure domains, and data center network
Any layer can become the bottleneck. Low GPU utilization is not necessarily a GPU problem; it may be caused by queuing policy, CPU decoding, model download, storage throughput, network congestion, request routing, or batching parameters. When reading and troubleshooting, you should verify layer by layer along the complete request or job path.
Where to Start¶
Complete Topic Map¶
Foundations and Architecture¶
- How Kubernetes Hosts AI: From APIs, controllers and schedulers to CRI, CNI, CSI and device interfaces.
- AI Cluster Architecture Design: Workload profiling, node pools, failure domains, single-cluster and multi-cluster boundaries.
- Kubernetes Flow Control and Service Rate Limiting: APF, fair queuing, client rate limiting, GPU job admission and model API traffic governance.
- Open-Source Kubernetes Cluster Management Tools and Approaches: From kubectl, Headlamp and GitOps, to layered selection of Rancher, Cluster API, Gardener, Karmada and OCM.
- Mainstream Domestic and International Cloud Vendor Kubernetes: Comparing ACK, TKE, CCE, EKS, GKE and AKS managed boundaries, network storage ecosystems and AI/GPU capabilities.
- Kubernetes Cross-Cluster and Large-Scale GPU: Federation history, current capabilities such as Karmada/MultiKueue, and training whole-Job placement and regional inference architecture.
- Karmada vs Virtual Kubelet Comparison: Architecture boundaries, replica semantics, failure recovery, network storage and GPU selection for cluster-level orchestration vs virtual node adaptation.
- Ten Years of AI on Kubernetes: From GPU Pods, Operators and batch scheduling, to DRA, inference gateways and disaggregated inference.
- Glossary: Unifying Kubernetes, GPU, training, inference, networking, RAG and reliability terminology.
Clusters, Nodes and Accelerators¶
- GPU Node Software Stack: Firmware, kernel, drivers, container runtime, CDI, Operators and node acceptance.
- Multi-Vendor Heterogeneous Accelerators: NVIDIA, AMD, Intel, TPU, Trainium/Inferentia and CPU/NPU.
- Device Plugin, CDI and DRA: Responsibilities of the three, migration paths and production selection.
- GPU and Heterogeneous Resource Scheduling: Full GPU, MIG, sharing, topology, affinity and fragmentation management.
Queues, Elasticity and Capacity¶
- Queues, Fair Sharing and Multi-Tenancy: Kueue, ClusterQueue, Flavor, Cohort, priority and preemption.
- AI Workload Elastic Scaling: HPA, KEDA, Cluster Autoscaler, Karpenter and queue coordination.
- GPU Cost and Capacity Planning: Unit economics, demand forecasting, utilization, Spot and FinOps.
Networking, Data and Model Artifacts¶
- RDMA and AI High-Speed Networking: InfiniBand, RoCE, GPUDirect, NCCL and layer-by-layer troubleshooting.
- Contiv, OVS and Cilium Chained Networking in Practice: VLAN networking, Socket LB and kube-proxy data path boundaries.
- AI Data, Storage and Caching: Object storage, shared files, local NVMe, data loading and cache hierarchy.
- Big Data on Kubernetes: Spark, Flink, Kafka, Trino, Lakehouse, Operators, queue scheduling, and training and RAG data pipelines.
- Model Artifacts, Distribution and Caching: Formats, versions, OCI Modelcar, cross-region replication, P2P, node caching, streaming loading and cold start.
Distributed Training¶
- Distributed Training Platform: Kubeflow Trainer, KubeRay, JobSet and the training lifecycle.
- Large Model SFT Introduction: Starting from a single Q&A sample, explaining Loss, LoRA, Batch, Epoch, Checkpoint, Dense, MoE and various parallelism approaches.
- Kubernetes Domain SFT Community Practices: Analyzing KubeFix, K8s Distill, KubeBench and ITBench, explaining how domain data, tool calling, security boundaries and executable evaluation should be designed.
- SFT Training in Practice: From Single-GPU LoRA to DeepSeek V4: Single-GPU closed loop, multi-GPU MoE, DeepSeek V4 and multi-node network benchmarks.
- DeepSeek V4 Two-Node RDMA Training Benchmark: Using three rounds of TCP/RDMA A/B, NCCL AllReduce/All-to-All and negative controls to explain which training truly benefits.
- SwanLab Self-Hosting and SFT Metrics: Official Helm deployment, PoC/production boundaries, ms-swift integration, real curves and version compatibility.
- From W&B Local to SwanLab: Combining two years of team-based W&B Local operations records with current SwanLab benchmarks, comparing features, production complexity, migration and licensing boundaries.
- Ray's Role in Large Model Training and Inference: End-to-end boundaries of Ray Core, Data, Train, Tune, Serve, Serve LLM and KubeRay.
- Reliability, Checkpoint and Failure Recovery: RPO/RTO, Spot, graceful exit and failure drills.
LLM Inference¶
- Running and Testing Large Models Locally: Using Ollama, llama.cpp, LM Studio, LocalAI, MLX-LM and vLLM/SGLang to verify model and application contracts.
- LLM Inference Platform Overview: Service abstraction, runtime, request path and capacity model.
- Inference Engine Selection: Boundaries of runtimes such as vLLM, SGLang, TensorRT-LLM, Triton and llama.cpp.
- LLM Serving and AI Microservice Frameworks: vLLM, KServe, AIBrix, Ray Serve, BentoML, NVIDIA NIM and application-layer frameworks.
- LLM Inference Performance Optimization: TTFT, TPOT, batching, KV Cache, quantization, parallelism and speculative decoding.
- KV Cache Principles, Applications and Kubernetes: Attention principles, GPU memory calculations, prefix reuse, hierarchical caching, and request routing, NUMA and scaling.
- Large Model API Relay and LLM Gateway Overview: Model aggregation, self-built unified APIs, enterprise AI Gateway, inference routing, semantic routing, security risks and selection.
- AI Gateway and Intelligent Routing: Gateway API Inference Extension, prefix awareness, load awareness and flow control.
- Higress AI Gateway in Practice: Isolated installation, AI Proxy, token governance, observability, and same-cluster and cross-cluster integration with AIBrix.
- Distributed and Prefill/Decode Separated Inference: Model parallelism, LeaderWorkerSet, llm-d, Dynamo and KV transfer.
RAG, Agent and Edge¶
- 2026 AI Agent Landscape, Implementation Principles, and Trends: Product landscape, implementation principles, frameworks, risks, and evolution directions for mainstream coding, browser, and enterprise agents.
- Agent Harness Technical Survey: Agent Loop, context, tools, state recovery, sandboxing, permissions, verification, and Kubernetes production architecture.
- Agent RL: veRL and Miles: Multi-turn trajectories, rewards and action masks, training frameworks, TITO, fully asynchronous pipelines, and Kubernetes engineering.
- DeepSeek Search/Fetch and Agent Web Costs: Search and retrieval roles, provider-pricing differences, and task budgeting.
- Omarchy Linux and Agent OS Survey: Positioning, working mechanisms, permissions, and enterprise adoption of desktop Linux, Agno, AIOS, and BrowserOS.
- ChatGPT Dots Technical Analysis: Release timing, persistent responsibilities, memory, cloud and local execution, Codex collaboration, plus enterprise permissions and Kubernetes integration recommendations.
- Agent Evaluation Methods Survey: Scoring methods for task success, tool trajectories, failure recovery, safety, cost, and human intervention.
- Harbor Agent Evaluation Framework Survey: Task, Agent Adapter, isolated environment, Verifier, Rollout, and Kubernetes productionization.
- Jev System One Decision Model Survey: Probabilistic decision interface without text generation, confidence, agent routing, community controversy, production architecture, and evaluation methods.
- Jev Weekly Review: Weekly tracking of official releases, independent evaluations, community weights, and agent applications, preserving historical results and judgments.
- HarnessRouter Survey: UHP, unified Harness API, Cloud and Community Edition, security boundaries, cost, and relationship with model gateways.
- HiRoute Agent Routing and Model Collaboration: Local routing engine from the Higress team, model selection at the parsing stage, Jev decisions, context preservation, and enterprise integration.
- DeepSeek Harness GitHub Repository Deep Dive: Source directory, Cordis plugin tree, Profile and Bundle, Agent Loop, event-sourced sessions, and capability seams.
- DeepSeek Harness Docker, Compose, and Helm Deployment in Practice: Multi-architecture images, EROFS fixes, state persistence, StatefulSet, Helm, and security exposure boundaries.
- From Docker to Kubernetes: DeepSeek Harness, Built-in Chromium, and DSH Plugin in Practice: All-in-one browser desktop, custom DSH Plugin, Tailscale remote entry, state volumes, Cilium probe conflicts, and security boundaries.
- RAG Infrastructure: Ingestion, chunking, Embedding, vector databases, retrieval, reranking, and permission filtering.
- Agent Sandbox Selection and Architecture Analysis: Threat models, Kubernetes Agent Sandbox, gVisor, Kata, microVMs, and managed platform decisions.
- OpenSandbox on Kubernetes in Practice: Official Console, file and command execution, four concurrent tasks, access authentication, expiry cleanup, and real monitoring screenshots.
- OpenKruise Agents on Kubernetes in Practice: Warm and on-demand creation, SDK tasks, filesystem separation, expiry cleanup, and troubleshooting a resume blocked by image-reference comparison.
- CubeSandbox Kubernetes Deployment Prerequisites and Production Evaluation: 60ms benchmark baseline, KVM/PVM, XFS, eBPF, Helm, and production rollout boundaries.
- CubeSandbox Agent Adapter v0.3 Field Test: Acceptance testing with four clients—OpenClaw, DSH, Hermes, and Codex—plus persistent leases, asynchronous Jobs, PTY, Checkpoint, Redis HA, multi-tenant identity, and migration Gates.
- OpenClaw as an Enterprise Agent Platform Foundation: Reusable capabilities, enterprise control plane gaps, security risks, secondary development boundaries, and recommended architecture.
- OpenClaw 2.0 Field Test: Architecture, Feature, Performance, and Migration Risk Comparison with 1.x: Isolated installation, Control UI, Workboard, headless agents, measured metrics, doctor migration, and rollback Gates.
- How to Rapidly Publish and Share Internal Enterprise AI Applications: Build, trial run, approval, permissions, runtime, and application catalog design for non-engineering users in business, legal, and operations.
- AI Agents, Sandboxes, and Tool Execution: RuntimeClass, network boundaries, credentials, tool permissions, and auditing.
- Edge AI and Cloud-Edge Collaboration: K3s, weak-network autonomy, device management, model OTA, and edge observability.
Platform Engineering and Production Operations¶
- GPU Notebook Platforms and Storage Selection in the LLM Era: JupyterHub, Kubeflow, managed Workbench, GPU sharing, user home directories, object storage, and local caching.
- MLOps and Platform Engineering: Pipelines, experiments, model registries, GitOps, and platform APIs.
- GPU, Training, and Inference Observability: DCGM, job metrics, TTFT/TPOT, Trace, SLOs, and alerting.
- AI Platform Security and Governance: Identity, Pod Security, image and model supply chains, and tenant isolation.
- Performance Benchmarking, Load Testing, and Regression: Hardware, NCCL, storage, training, inference, and release gates.
- Platform Operations, Upgrades, and Multi-Cluster: Version matrices, Canary, CRD, backup, disaster recovery, and incident response.
- AI on K8s Adoption Roadmap: From current-state assessment to a 30/60/90-day implementation plan.
Reference Architectures and Experiments¶
- Hands-On Practice, Troubleshooting, and Selection: GPU Pending, low utilization, inference engine field tests, cost calculation, model distribution, Spot recovery, and security attack/defense.
- Production Reference Architectures: Small GPU platforms, multi-tenant training, high-availability inference, disaggregated inference, and agent sandboxes.
- Minimal GPU Platform Closed-Loop Experiment: Resource discovery, GPU smoke tests, vLLM serving, network policies, cold start, and graceful shutdown.
- AI/LLM Cluster Component Checklist: Components, necessity, rationale for introduction, and acceptance criteria listed by target scenario.
Tools Are Not Architecture¶
Multiple projects are usually available for the same layer, and projects may overlap. Before choosing a tool, write down the inputs, outputs, owners, and acceptance metrics first.
| Capability | Common Implementations | Questions to Answer First |
|---|---|---|
| Device access | Device Plugin, CDI, DRA, vendor Operators | Do you need full-GPU, slicing, topology, or dynamic claims? |
| Batch scheduling | kube-scheduler, Kueue, Volcano | Do you need admission queues, fair sharing, or Gang Scheduling? |
| Big data compute | Spark, Flink, Trino, Ray Data | Is it batch processing, streaming state, interactive SQL, or AI data preparation? |
| Training control | Kubeflow Trainer, JobSet, KubeRay | What are the training framework, fault tolerance, and elasticity boundaries? |
| Model serving | KServe, Seldon, custom controllers | Do you need standard model APIs, multi-model, or LLM-specific capabilities? |
| Inference runtime | vLLM, SGLang, TensorRT-LLM, Triton | What are the target model, hardware, latency, and throughput? |
| Request ingress | Gateway API, Inference Extension, service mesh | Does routing need to understand model, KV Cache, and queue state? |
| Agent execution | Agent Sandbox, gVisor, Kata, managed Sandbox APIs | Are lifecycle, isolation runtime, and tool authorization already layered? |
| Observability | Prometheus, OpenTelemetry, DCGM Exporter | Can you trace from user requests down to Pod, GPU, network, and model version? |
Content Status and Update Rules¶
stable: Principles and production methods are relatively stable, but still need to be validated against your target Kubernetes and component versions.evolving: Upstream APIs, project boundaries, or best practices are still changing rapidly; check official release notes before going live.lab: Minimal experiments for reproduction and learning; should not be copied directly into production without review.last_reviewed: Date of the most recent review against primary sources; does not mean all dependencies are pinned to that date.- Examples primarily express structure and validation methods; production configurations must additionally complete image pinning, capacity, identity, secrets, backup, SLOs, and change processes.
Recommended Build Order¶
- First establish a repeatable acceptance baseline for nodes, drivers, networking, storage, and GPU.
- Then unify the resource model, queues, tenants, images, model artifacts, and observability.
- Establish golden paths for training, online inference, offline inference, RAG, and agents respectively.
- Use performance benchmarks, failure drills, cost metrics, and upgrade matrices to form continuous delivery gates.
- Finally, introduce DRA, advanced topology, disaggregated inference, multi-cluster, and complex scheduling policies based on scale.
If you are planning a first-version platform, you can start from the Production Reference Architectures and pick the closest starting point, then use the Adoption Roadmap to break it into phased goals.