Field Guides / Running LLMs on Kubernetes
Field Guide · Intermediate to Advanced · 12-14 hours with labsRunning LLMs on Kubernetes
Serve open LLMs on Kubernetes with confidence: size GPUs with real maths, deploy vLLM, autoscale on the right signals and route traffic smartly.




93
pages
pages
12
hands-on labs
hands-on labs
24
interview Q&As
interview Q&As
13
chapters
chapters
This is for you if
- You run Kubernetes and your team now wants to self-host LLMs
- You need to size, justify and control a GPU bill with real numbers
- You're on call for model servers and want a playbook for slow, stuck or broken inference
- You're interviewing for platform, SRE or AI infrastructure roles
What's inside
- Prefill, decode, KV cache, PagedAttention and continuous batching explained in infrastructure terms
- GPU memory and KV cache formulas with worked examples, plus a calculator script that reads any model's config.json
- vLLM, SGLang, Ollama and llama.cpp compared, with TGI's maintenance-mode status and what to move to
- GPU scheduling end to end: GPU Operator, device plugin, labels and taints, time-slicing, MIG and DRA
- A production vLLM manifest explained field by field, plus a real GPU lab on GKE with costs and teardown
- Model storage and cold starts: OCI image volumes, mirrors, streaming loaders and a phase-by-phase cold start lab
- vLLM and DCGM metrics, the PromQL that matters and alert rules worth paging on
- KEDA autoscaling on in-flight requests, the scale-to-zero trap, and the Gateway API Inference Extension (InferencePool v1)
- Cost per million tokens, model provenance and network isolation, 24 interview Q&As, cheat sheets and a 30-day plan
After this guide you can
- Calculate whether a model fits a GPU and how many concurrent users it can serve
- Deploy vLLM or Ollama on Kubernetes with correct probes, storage and security settings
- Schedule and share GPUs with taints, selectors, time-slicing or MIG
- Autoscale inference on queue and in-flight metrics with KEDA and explain the cold start limits
- Monitor TTFT, inter-token latency, KV cache and GPU health with Prometheus
- Defend serving, routing and cost decisions in design reviews and interviews
Contents
- How LLM inference really worksp. 4
- The numbers: memory math, quantization and batchingp. 9
- Serving engines: vLLM, Ollama, SGLang and the restp. 19
- GPU scheduling on Kubernetesp. 27
- Deploying vLLM with an OpenAI-compatible APIp. 35
- Model storage and cold startsp. 43
- Observability for LLM servingp. 49
- Autoscaling and LLM-aware routingp. 57
- Cost control and securityp. 67
- Troubleshooting playbookp. 74
- Production checklist and design decisionsp. 78
- Interview questionsp. 80
- Cheat sheet and 30-day planp. 89
Written by Randy, a Senior Platform Engineer & SRE who runs production platforms on AWS, GCP and Azure. Companion to the Techworld with Randy episode Running LLMs on Kubernetes.