Autoscale LLM Inference from a Queue with KEDA
Expert · 60 minutes · 5 tasks, checked automatically · 100 points
In this expert-level MLOps lab you will build a production-style autoscaling pipeline for LLM inference workloads. You will deploy KEDA (Kubernetes Event-Driven Autoscaling) on a local kind cluster, stand up a Redis stream as a simulated inference request queue, deploy a mock LLM inference worker Deployment, and wire a KEDA ScaledObject to automatically scale the workers based on queue depth. Finally you will drive load into the queue and observe KEDA scale the Deployment from zero to multiple replicas and back down. This pattern is directly applicable to real LLM serving stacks (vLLM, TGI, Triton) where GPU workers must scale on demand without wasting expensive resources at idle.
What you’ll learn
- Install KEDA via Helm and verify its operator components are healthy
- Deploy Redis as a queue backend and a mock LLM inference worker Deployment that scales to zero at idle
- Configure a KEDA ScaledObject targeting the Redis list length and validate end-to-end autoscaling under synthetic load
How this lab works
- Start the lab: One click starts a real Kubernetes cluster on your computer (kind), with kubectl ready in a toolbox terminal.
- Work through 5 tasks: Each task says what to build or fix. You do it yourself, in a real terminal, with hints when you get stuck.
- Check your work: Check my work reads your live cluster and says, task by task, what passed and what to fix.
- Finish and keep going: 100 points, your progress saved, and the next lab to try.
What it runs on
- Cluster: A real Kubernetes cluster on your computer (kind)
- Kubernetes: 1.34.8
What you need
- A free LearnXops account
- The LearnXops desktop app for macOS, Windows or Linux
- Docker Desktop installed and running
- A kind cluster created in the Kubernetes Playground
Topics: keda, autoscaling, llm, inference, redis, queue, scale-to-zero, mlops, helm, kubernetes
Create a free account to start this lab.
Keep going
- Distributed PyTorch Training with the Training Operator (PyTorchJob)
- Distributed TensorFlow with TFJob on Kubernetes
- Hyperparameter Tuning with Katib on Kubernetes
- All-Reduce Training with MPIJob
- Fine-Tune a Small Language Model as a Job (LoRA, CPU)
- Share GPUs with Time-Slicing via the NVIDIA GPU Operator