Deploy a RAG app
Frame the production-shaped RAG deploy experiment
Ship a falsifiable slice of **containerized café FAQ RAG with readiness probes and versioned index pin** — success is kubectl rollout status shows ready; /readyz 200 only when index pin matches, not a polished screenshot.
1Try it yourself
Playground
Deploy RAG checklist
Check each ship gate before sending customer traffic to your RAG app.
2Learn the idea
Read
Name the operable slice
This lab builds containerized café FAQ RAG with readiness probes and versioned index pin. The human in the loop is platform engineer shipping faq-index@sha256:a1b2 to staging. Scope is intentionally narrower than “make AI reliable”: you will prove one oracle — kubectl rollout status shows ready; /readyz 200 only when index pin matches — and one invariant — readyz fails if index digest ≠ pinned digest; rollback restores previous digest in < 2 min. Record non-goals in your notes so a later change cannot silently expand authority. The incident mnemonic for the chapter is DEPLOY-EMPTY-INDEX-5; design as if that ticket is already written and you are filling evidence.
Read
Write the acceptance contract
Turn the oracle into a table: input fixture, expected observable, prohibited side effect, owner, latency/cost ceiling. Separate model taste from software correctness — transport, auth, parsing, and termination must be deterministic even when generated text varies. Primary metric family: ready_ratio == 1 and citation_miss_rate ≤ 0.02 during rollout. Averages without a denominator or revision label do not gate release. Fake external dependencies in unit tests; live calls wait until fakes pass.
Read
Implementation artifact
env:
INDEX_DIGEST: "sha256:a1b2c3"
readinessProbe:
httpGet: { path: /readyz, port: 8080 }
failureThreshold: 3
Read
Freeze the first red test
Before implementation, encode a failing check that would have caught new pods serve empty index while old pods terminate — citation miss spike. That failure is the pedagogical north star for later pages: contracts reject it, happy path never performs it, validation asserts it, failure-handling contains it, observability detects it, security-ops prevents privilege tricks around it, and mastery replays it in a drill. Endpoint under study: GET /readyz.
Read
Stage depth
Capacity note for planners: estimate peak demand on GET /readyz and the cost ceiling for a failed retry storm. Write the abort conditions — unbounded spend, cross-tenant leakage, or inability to roll back — before you enjoy the first green test. Prefer synthetic fixtures shaped like production over anonymized production dumps you cannot share in class. When you are tempted to widen scope, re-read the oracle (kubectl rollout status shows ready; /readyz 200 only when index pin matches) and cut features that do not serve it. The teaching outcome is judgment under constraints: platform engineer shipping faq-index@sha256:a1b2 to staging gets a trustworthy control, not a kitchen-sink framework. Keep the language of release decisions: promote, hold, or roll back — never “see if it gets better.”
Read
Field notes for `deploy-rag-app` / `lab-goal`
Decide what will live in version control on day one: fixtures, contract markdown, and a failing test name. Write the cost ceiling as a hard number with currency and period. If the lab involves clusters, name the non-prod context you will use and forbid prod kubecontexts in scripts. Capture the baseline metric once before changing code so later gains are comparative. Refuse tools that hide the request path behind magic macros until the oracle is green on fakes. Your README section for this page should be five lines or fewer and still falsifiable. In this chapter the product is containerized café FAQ RAG with readiness probes and versioned index pin, the human stakeholder is platform engineer shipping faq-index@sha256:a1b2 to staging, and the incident id you design against is DEPLOY-EMPTY-INDEX-5. Re-state the oracle in your notes — kubectl rollout status shows ready; /readyz 200 only when index pin matches — and keep the invariant visible: readyz fails if index digest ≠ pinned digest; rollback restores previous digest in < 2 min. Track ready_ratio == 1 and citation_miss_rate ≤ 0.02 during rollout as the scoreboard. Surface under change control: GET /readyz.
Go deeper
Before you start
Why this matters
Write the single done-definition a reviewer would accept for Deploy a RAG app (DEPLOY-EMPTY-INDEX-5). Include the numeric gate hidden in this oracle: kubectl rollout status shows ready; /readyz 200 only when index pin matches. Then name the fake success you refuse: a demo that ignores new pods serve empty index while old pods terminate — citation miss spike. Keep the sentence beside your editor; every later page should make this sentence easier to prove.
In the wild
See how this idea shows up as a product and a company — then come back to the lesson. Skills transfer across vendors.
Related lessons
Check your understanding
Page assessment
Answer from memory. Completion is saved from this evidence, not from opening the next page.
All responses are required.