Skip to content
Hands-on course · 17 days

RAG infrastructure on Kubernetes hands-on

You run an assistant that answers questions with sources from your own documents – with measured quality, a replica, backups, re-indexing without downtime, security and metrics – and finally solve a failure with three hidden causes from your own measurements.

  • Free · no subscription
  • 17 days · 75–150 min each
  • 125 drills · with expected output
Day 1 · Drill 4: Answering with and without a card
# on rag1
$ curl -s http://127.0.0.1:11434/api/generate -d @mit-anfrage.json -o mit.json
# on rag1
$ jq -r .response mit.json

Expected

Druckdienst neu starten: Melde dich am Druckserver druck01 an und führe sudo systemctl restart cups aus. Prüfe danach mit lpstat -r, ob der Dienst läuft. Hängen Aufträge, leere die Warteschlange mit cancel -a.

As a book · Edition 2026 · PDF and EPUB

The whole course to take with you, for reading away from the screen. Reading online stays free.

With Pro: as your book of the month Pro launches soon. With a free account you can join the Pro waitlist.
Leanpub · soon Amazon · soon

What you'll be able to do

  • Run a RAG pipeline yourself: embedding service, ingestion pipeline, vector store and an answer service with sources on Kubernetes
  • Compare Qdrant and PostgreSQL/pgvector with the same data and measure retrieval quality with a test bench (hit@k, MRR) instead of guessing
  • Practise replication, node failure, backup and restore, and re-indexing without downtime behind an alias
  • Secure the store with API keys, network policies and source rules, observe it with Prometheus and solve a failure with several causes

What you need

LabTwo VMs with Ubuntu 24.04, SSH access and sudo on a shared network – the first with at least 4 vCPU/8 GB/40 GB (models and vector databases on the CPU), the second with 2 vCPU/4 GB/20 GB

BackgroundLinux in the terminal, Kubernetes basics (pods, deployments, kubectl), reading Python

InternetInternet access from the VMs for the downloads (k3s, Helm charts, Ollama and the models); no GPU and no API key needed

Prior knowledgeThe course is self-contained: cluster, models, vector databases, test data and every failure are built in the course. It is for platform engineers, SREs and developers who want to run RAG applications, not just build them.

Set up your labKubernetes locally · Lab VMs

Training plan

One day = one sitting. Every day ends with a checkpoint and a challenge. About 31 hours in total.

Training days

  1. Preparation Building the Library – Two VMs, a Cluster and the First ModelsSet up access to two VMs, build a Kubernetes cluster with two nodes, install Ollama with an embedding model and a small language model, and measure a baseline 90 min
  2. Day 1 RAG by Hand – Classify, Compare, Answer from a CardWalk the whole path of a question once without any helpers: turn texts and question into vectors, find the matching card by similarity, and let the language model answer using only that card 75 min
  3. Day 2 Measuring Embeddings – Which Classification System Fits?Compare two embedding models with the same cards and questions – dimensions, hits, duration, memory – and find out what happens with texts that are too long 75 min
  4. Day 3 The Embedding Service on KubernetesThe embedding model moves from the host into the cluster: as a deployment with its own volume for the models, reachable through a service, ready immediately after every restart – and you measure what a CPU limit costs 90 min
  5. Day 4 Running Qdrant – the Card CabinetInstall Qdrant with Helm as a StatefulSet, create a collection, store the four cards with payload, search and filter – and check that the data survives a restart 75 min
  6. Day 5 pgvector in Comparison – the Same Cabinet in PostgreSQLRun PostgreSQL with CloudNativePG, switch on pgvector, store the same four cards and run the same searches as in Qdrant – hits, filters and index compared directly 75 min
  7. Day 6 The Ingestion Pipeline – the Intake DeskLoad documents, clean them, split them into cards, stamp them and store them in Qdrant – as a Kubernetes job that duplicates nothing on its second run and replaces changed cards 90 min
  8. Day 7 Measuring Retrieval Quality – the Test BenchCreate test questions with expected sources, build a test bench as a job, measure hits@k and MRR – and use them to compare card size, overlap and heading instead of guessing 100 min
  9. Day 8 Hybrid Search and RerankingPut keyword search (BM25) next to vector search, run a reranker as a service of its own – and use the test bench to measure what both bring and what they cost 120 min
  10. Day 9 The Answer ServiceConnect search and language model into one service that answers with source references, streams the answer, does not wait forever and can say "I don't know" – and measure where the time goes 120 min
  11. Day 10 Load and Latency BudgetMeasure what happens to the answer service when many questions come in – which stage slows things down, how long users wait, when memory runs out – and set up the desk so that in a rush it honestly says "come back later" instead of making everyone wait 150 min
  12. Day 11 Replication and Node FailureRun Qdrant on two nodes, give the collection wissen a replica and then let rag2 really fail – measure what search, answer service, writes and management commands experience during that time, and how everything comes back 120 min
  13. Day 12 Backup and RestoreBack up the collection wissen and the PostgreSQL database rag, then cause real damage (collection deleted, table dropped), restore both and measure with clock times what was lost (RPO) and how long the desk was gone (RTO) – in production and in a fresh, empty environment 90 min
  14. Day 13 Reindexing without downtimeWrite the cards with a new embedding model into a second collection, compare it against the old one on the test bench from Day 7 and switch the answer service over via an alias – without a single request failing, with a measured way back 120 min
  15. Day 14 SecurityProtect the collection against foreign pods, foreign tenants and smuggled-in instructions – with keys for Qdrant, a read-only role in PostgreSQL, NetworkPolicies, a tenant filter and fixed rules at the receiving desk and the desk; every wall measured before and after 150 min
  16. Day 15 ObservingSee the information desk in operation instead of guessing – collect metrics from Qdrant, PostgreSQL and the answer service in a small, self-operated Prometheus, measure the latency of every stage, count quality in operation and make an error visible that every status check misses 150 min
  17. Day 16 Final caseSolve a fault with several causes – using only the tools of the last fifteen days: tally sheet and pinboard (Day 15), sign and way back (Day 13), output rule (Day 14), timeouts (Days 9 and 10), test bench (Day 7). Each cause with evidence, repair and counter-check, and a report at the end 150 min

More