Day 16: Final case – the city library in an emergency
Goal: narrow down and fix three real incidents without a solution shown in advance, measure the recovery of a deleted collection with RPO and RTO, and check the installation against a production readiness checklist · Duration: about 150 min · Prerequisite: Day 0 to Day 15
State before this chapter
Qdrant runs with three pods under Argo CD (Day 15), with TLS, API
keys, NetworkPolicies and Pod Security restricted (Day 10).
Monitoring with the alerts from Day 11 and the off-site store from Day
12 are in place on vdb1. Changes to Qdrant only go through a commit in
~/bibliothek.
# on vdb1
kubectl -n qdrant get pods -o wideExpected (your IPs and ages will differ):
NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES
qdrant-0 1/1 Running 0 41m 10.42.1.70 vdb2 <none> <none>
qdrant-1 1/1 Running 0 42m 10.42.3.9 vdb4 <none> <none>
qdrant-2 1/1 Running 0 43m 10.42.2.19 vdb3 <none> <none>
# on vdb1
~/werkbank/bin/argocd app list --kube-context argocdExpected (shortened on the right):
NAME CLUSTER NAMESPACE PROJECT STATUS HEALTH SYNCPOLICY CONDITIONS
argocd/qdrant https://kubernetes.default.svc qdrant default Synced Healthy Manual <none>
argocd/regeln https://kubernetes.default.svc qdrant default Synced Healthy Auto <none>
All commands run on vdb1 in the folder
~/labor/tag16:
# on vdb1
mkdir -p ~/labor/tag16
cd ~/labor/tag16Introduction
For fifteen days you knew in advance what would break – after all, you triggered it yourself. In operations it is the other way around: first comes a symptom, an alert or a phone call, and the cause lies somewhere between Git, Kubernetes, network and database. Today you practice exactly that.
The chapter has two parts. In the incident part, a colleague prepares each incident – you carry out these steps without reading the solutions part. Afterwards you get the symptom, a task and staggered hints. The solutions part at the end contains the complete path for each incident with the real outputs from the lab. Finally, you check the whole installation against a production readiness checklist – and in the process also find points that are not yet met.
Today you will learn:
- to find, from a latency alert without errors, a cause that does not lie in Qdrant,
- to fix a block caused by a NetworkPolicy that Argo CD keeps restoring,
- to bring back an accidentally deleted collection from the off-site store and measure RPO and RTO,
- in every case to ask first: what changed last, and where is that recorded?
- to check an installation against a production readiness checklist with individual commands,
- to take down the lab in an orderly way.
Background
The picture of the day: an emergency in the city library
So far you have built the library, remodeled it and held fire drills. Today is the day when something really happens: readers complain that borrowing takes forever. The workbench at the building authority can no longer get into the building. And a temp has struck an entire holdings from the catalog.
Whoever is on call always proceeds the same way. First assess the situation: what exactly is broken, what still works? Then look for changes: what happened last – in the plan (Git), in the building (Kubernetes), in the lending statistics (monitoring)? Only then intervene, and do it on the plan, not just on the shelf, otherwise the building inspector restores the fault. Finally prove that it works again, and note what is missing so that it does not happen again.
The terms
| Term | Meaning | In the picture |
|---|---|---|
| Incident | unplanned disruption of the service | water damage, power cut |
| Symptom | what users or alerts see | complaint at the lending desk |
| Cause | what actually triggers the disruption | the leaking pipe |
| Mitigation | end the disruption, even without a final fix | turn off the water |
| CPU throttling | the kernel pauses a container as soon as its CPU limit is used up within a 100 ms period | desk closes for 30 seconds every minute |
| RPO | how much data is lost in the worst case (time since the last backup) | loans since the last inventory |
| RTO | how long the recovery takes | until the new branch opens |
| Postmortem | written blameless review | damage report to the council |
| Production readiness | verifiable minimum standard for operations | acceptance by the building inspector |
Remember: The first question in an incident is not “What is broken?” but “What changed?”. With GitOps, the answer is usually in the Git log – and that is where the fix belongs too.
How you work today
Every incident has the same form:
- Preparation by the colleague. These steps trigger the incident. You carry them out as if you were the colleague – and afterwards forget what you typed. If you practice in pairs, the other person does this and you look away.
- Report. The symptom, as it arrives in operations.
- Task. What you should find out and fix.
- Hints. Staggered; only read the next one if you are stuck for ten minutes.
The solutions are collected in the solutions part. Before you look, write down what you think the cause is and which command you use to prove it.
Incident 1: “Borrowing takes forever”
Preparation by the colleague
The colleague read in a review that limits should equal requests, and rolls out a small change to the Qdrant values. She writes it as a patch – a file that contains only the changed lines and a few lines of context.
Step 1 – create the patch.
# on vdb1
nano limits.patchdiff --git a/qdrant/werte.yaml b/qdrant/werte.yaml
index 8f38a40..059133f 100644
--- a/qdrant/werte.yaml
+++ b/qdrant/werte.yaml
@@ -19,6 +19,7 @@ resources:
cpu: 500m
memory: 1Gi
limits:
+ cpu: 500m
memory: 2Gi
containerSecurityContext:@@ -19,6 +19,7 @@– from line 19, six lines become seven.- The line with
+is added; the lines without a prefix are context, by whichgit applyrecognizes the location. The empty context line begins with a space.
Step 2 – check whether the patch fits.
# on vdb1
cd ~/bibliothek && git apply --check ../labor/tag16/limits.patch && echo passtgit apply --check– only checks whether the patch applies cleanly, and changes nothing.&& echo passt– prints a confirmation only on success.
Expected:
passt
Step 3 – apply.
# on vdb1
cd ~/bibliothek && git apply ../labor/tag16/limits.patchNo output means: applied.
Step 4 – commit as the colleague.
# on vdb1
cd ~/bibliothek && git commit -a --author="Mara Kollegin <[email protected]>" -m "Qdrant: CPU-Limit wie Request (Review-Hinweis)"-a– include all changed, already tracked files.--author=…– records another person as the author; the committer remains the workbench user. This makes the Git log look like it does in a team.-m– the reason.
Expected:
[main cd14d03] Qdrant: CPU-Limit wie Request (Review-Hinweis)
Author: Mara Kollegin <[email protected]>
1 file changed, 1 insertion(+)
Step 5 – push.
# on vdb1
cd ~/bibliothek && git pushExpected:
To /srv/git/bibliothek.git
7709e56..cd14d03 main -> main
Step 6 – roll out, as on Day 15. First fetch the new commit, then apply, then wait.
# on vdb1
~/werkbank/bin/argocd app get qdrant --refresh --kube-context argocdExpected (excerpt):
Sync Policy: Manual
Sync Status: OutOfSync from 1.20.3
Health Status: Healthy
# on vdb1
~/werkbank/bin/argocd app sync qdrant --kube-context argocdExpected (excerpt):
Sync Revision: 1.20.3, cd14d03277b8ee29a4f633b5fb9792d1dc7a15cc
Phase: Succeeded
apps StatefulSet qdrant qdrant Synced Progressing statefulset.apps/qdrant configured
# on vdb1
~/werkbank/bin/argocd app wait qdrant --sync --health --timeout 600 --kube-context argocdExpected (excerpt, after just under three minutes – 07:49:17 to 07:52:05):
Sync Status: Synced to 1.20.3
Health Status: Healthy
Step 7 – the readers arrive. In a second terminal on vdb1, start the load generator from Day 11 with 16 readers and 40,000 requests and let it run.
# on vdb1, zweites Terminal
cd ~/labor/tag16 && ~/werkbank/bin/python ../tag11/last-prozesse.py https://10.43.151.237:6333 doku ../tag01/fragen.npy 16 40000You know the arguments from Day 8 and 11: address, collection, query file, 16 readers, 40,000 requests.
Report
Three minutes later, at 07:55:18, Prometheus’s alert list shows:
{"alertname":"QdrantSucheZuLangsam","state":"firing","value":"5.8434503302688e-01"}
{"alertname":"NodeSystemSaturation","state":"pending","value":"2.49e+00"}
{"alertname":"Watchdog","state":"firing","value":"1e+00"}
{"alertname":"InfoInhibitor","state":"firing","value":"1e+00"}
{"alertname":"CPUThrottlingHigh","state":"pending","value":"6.977095444326532e-01"}
{"alertname":"CPUThrottlingHigh","state":"pending","value":"5.072869036724159e-01"}
And at the end the load generator reports:
parallel 16 (Prozesse) · 40000 Anfragen in 622.1 s · 64 Anfragen/s · p50 109.1 ms · p95 401.3 ms · p99 595.0 ms · max 996.6 ms · Fehler 0
On Day 11, the same load generator managed 505 requests per second with 16 readers.
Task
Find out why 58 % of the searches take longer than 50 ms even though there is not a single error. Prove the cause with measurements, fix it so that it does not come back, and prove that the search is fast again.
Hints
- Are the pods healthy? Are there errors, restarts, OOMKills? If not: what does a search wait for when nothing is broken?
- Look at the pods’ CPU – not just how much, but whether the values
are suspiciously identical. What does the alert that is still
pendingsay? - What changed in the last hour? Argo CD has a history, Git has a log.
Incident 2: “The workbench can’t get in any more”
Preparation by the colleague
The colleague is tidying up the NetworkPolicies. She finds the allow
rule for the workbench via 10.42.0.0/32 odd – vdb1 has the
address 172.16.0.182, after all.
Step 1 – create the patch.
# on vdb1
nano werkbank.patchdiff --git a/regeln/freigaben.yaml b/regeln/freigaben.yaml
index 5250c08..5b05fce 100644
--- a/regeln/freigaben.yaml
+++ b/regeln/freigaben.yaml
@@ -37,7 +37,7 @@ spec:
matchLabels:
qdrant-zugriff: "ja"
- ipBlock:
- cidr: 10.42.0.0/32
+ cidr: 172.16.0.182/32
ports:
- port: 6333
- port: 6334- The line with
-is removed, the one with+is added – a changed line is always a pair in a patch.
Step 2 – apply.
# on vdb1
cd ~/bibliothek && git apply ../labor/tag16/werkbank.patchStep 3 – commit.
# on vdb1
cd ~/bibliothek && git commit -a --author="Mara Kollegin <[email protected]>" -m "Regeln: Werkbank über ihre Knotenadresse freigeben"Expected:
[main bbee54a] Regeln: Werkbank über ihre Knotenadresse freigeben
Author: Mara Kollegin <[email protected]>
1 file changed, 1 insertion(+), 1 deletion(-)
Step 4 – push.
# on vdb1
cd ~/bibliothek && git pushExpected:
To /srv/git/bibliothek.git
234699a..bbee54a main -> main
(For you, the commit before .. is the one with which you
fixed Incident 1.)
Step 5 – let Argo CD fetch the commit. The
Application regeln has selfHeal and automatic
sync (Day 15). Without --refresh, the commit would only
arrive with the next poll, in up to three minutes.
# on vdb1
~/werkbank/bin/argocd app get regeln --refresh --kube-context argocdExpected (excerpt):
Sync Status: OutOfSync from main (bbee54a)
Health Status: Healthy
A few seconds later, Argo CD has applied it by itself.
Report
The script that checks the collection list every night reports:
# on vdb1
cd ~/labor/tag16 && date +%T && curl -sS --cacert ../tag10/ca.crt -H "api-key: $(cat ../tag10/lese-key)" https://10.43.151.237:6333/collections -o liste.json; echo "Exit-Code $?"Expected:
08:06:41
curl: (7) Failed to connect to 10.43.151.237 port 6333 after 1 ms: Couldn't connect to server
Exit-Code 7
The pods are running; Argo CD shows everything Synced
and Healthy.
Task
Find out why the workbench can no longer reach Qdrant, and restore access so that it still works in five minutes. While doing so, check whether monitoring is affected too.
Hints
- “after 1 ms” and “Couldn’t connect”: is that a timeout or a rejection? Who rejects connections that quickly in this cluster (Day 10)?
- With which source address does the workbench arrive at the pod? Compare it with the allow rule.
- If your fix only lasts a few seconds: who restores the old state?
Incident 3: “The doku holdings are gone”
Preparation by the colleague
This time it is a chain: the nightly backup runs, a few more entries are added afterwards, and then a temp uses the admin key to delete the wrong collection.
Step 1 – Who has a copy of doku?
# on vdb1
cd ~/labor/tag16 && curl -sS --cacert ../tag10/ca.crt -H "api-key: $(cat ../tag10/admin-key)" https://10.43.151.237:6333/collections/doku/clusterExpected (your peer IDs will differ):
{"result":{"peer_id":857928665674298,"shard_count":1,"local_shards":[{"shard_id":0,"points_count":13220,"state":"Active"}],"remote_shards":[{"shard_id":0,"peer_id":121400021250061,"state":"Active"}],"shard_transfers":[]},"status":"ok","time":0.000598266}
doku has one shard with two copies: at the responding
peer (qdrant-1) and at 121400021250061 (qdrant-0, see
GET /cluster). So each of the two has all points.
Step 2 – the “nightly” backup. A collection snapshot
directly at qdrant-0. Via snapshots_storage: s3 it lands in
the off-site store (Day 12) and contains not only the data but also the
collection’s configuration. You read the pod IP from
kubectl -n qdrant get pods -o wide.
# on vdb1
cd ~/labor/tag16 && date +%T && curl -sS --resolve qdrant-0.qdrant-headless:6333:10.42.1.76 --cacert ../tag10/ca.crt -H "api-key: $(cat ../tag10/admin-key)" -X POST "https://qdrant-0.qdrant-headless:6333/collections/doku/snapshots?wait=true"--resolve name:port:ip– connects to the pod IP, but checks the certificate against the name (Day 10).?wait=true– only responds when the snapshot is finished.
Expected:
08:08:30
{"result":{"name":"doku-121400021250061-2026-12-06-08-08-30-0.snapshot","creation_time":"2026-12-06T08:08:37","size":109725696},"status":"ok","time":6.948093802}
Step 3 – entries are added after the backup. Wait about half a minute; then the script from Day 11 writes five points with the numbers 960000 to 960004.
# on vdb1
cd ~/labor/tag16 && ~/werkbank/bin/python ../tag11/schreiben.py https://10.43.151.237:6333 doku 960000 5Expected:
08:09:17 Punkt 960000: geschrieben
08:09:17 Punkt 960001: geschrieben
08:09:17 Punkt 960002: geschrieben
08:09:17 Punkt 960003: geschrieben
08:09:17 Punkt 960004: geschrieben
Step 4 – the slip.
# on vdb1
cd ~/labor/tag16 && date +%T && curl -sS --cacert ../tag10/ca.crt -H "api-key: $(cat ../tag10/admin-key)" -X DELETE https://10.43.151.237:6333/collections/dokuExpected:
08:09:48
{"result":true,"status":"ok","time":0.383419041}
No confirmation prompt, no recycle bin: 0.38 seconds.
Report
Ten seconds later, from the application:
# on vdb1
cd ~/labor/tag16 && date +%T && curl -sS --cacert ../tag10/ca.crt -H "api-key: $(cat ../tag10/lese-key)" https://10.43.151.237:6333/collections/dokuExpected:
08:09:58
{"status":{"error":"Not found: Collection `doku` doesn't exist!"},"time":0.000102366}
Task
Bring doku back from the off-site store – with the same
configuration (768 dimensions, cosine, two copies, payload index on
bereich). Measure the time from noticing to the collection
being green again (RTO) and determine which data is lost (RPO). Check
whether both copies are really back.
Hints
- Which backups of
dokuare in the off-site store, and which is the most recent? Do you need a collection or a shard snapshot if the collection no longer exists at all? - Qdrant does not restore directly from
s3://(Day 12). How does it get to the file anyway? - For the RPO: what was written after the backup? Query exactly those points.
Solutions part
Only read on here once you have written down your own guess.
Solution to Incident 1: the desk that closes every second
Step 1 – situation: is anything broken?
# on vdb1
kubectl -n qdrant get podsExpected:
NAME READY STATUS RESTARTS AGE
qdrant-0 1/1 Running 0 4m29s
qdrant-1 1/1 Running 0 5m31s
qdrant-2 1/1 Running 0 6m13s
All ready, no restarts. The error rate from Day 11:
# on vdb1
curl -sS http://10.43.23.41:9090/api/v1/query --data-urlencode 'query=qdrant:fehler:anteil5m' | jq -c '.data.result[] | .value[1]'Expected:
"0"
What you see: Qdrant answers correctly, just slowly. So this is about waiting time, not defects.
Step 2 – the pods’ CPU.
# on vdb1
kubectl -n qdrant top podsExpected (during the load):
NAME CPU(cores) MEMORY(bytes)
qdrant-0 499m 555Mi
qdrant-1 499m 522Mi
qdrant-2 444m 436Mi
What you see: Two pods are at exactly 499m – on vdb2 with eight cores. A value that does not move is a ceiling, not load.
Step 3 – is it being throttled? The alert
CPUThrottlingHigh was pending. Which pods does
it mean? You fetch the alert list as a file and filter it with
jq:
# on vdb1
cd ~/labor/tag16 && curl -sS http://10.43.23.41:9090/api/v1/alerts -o alarme.json# on vdb1
cd ~/labor/tag16 && jq -c '.data.alerts[] | select(.labels.alertname=="CPUThrottlingHigh") | {pod: .labels.pod, container: .labels.container, value}' alarme.jsonExpected:
{"pod":"qdrant-0","container":"qdrant","value":"6.977095444326532e-01"}
{"pod":"qdrant-1","container":"qdrant","value":"5.072869036724159e-01"}
More precise is the share of 100 ms periods in which the kernel paused the container, over the last minute:
# on vdb1
curl -sS http://10.43.23.41:9090/api/v1/query --data-urlencode 'query=sum by (pod) (rate(container_cpu_cfs_throttled_periods_total{namespace="qdrant",container="qdrant"}[1m])) / sum by (pod) (rate(container_cpu_cfs_periods_total{namespace="qdrant",container="qdrant"}[1m]))' | jq -c '.data.result[] | [.metric.pod, .value[1]]'| Part | Meaning |
|---|---|
container_cpu_cfs_periods_total |
number of 100 ms periods in which the container wanted CPU |
container_cpu_cfs_throttled_periods_total |
of those, the periods in which it had used up its limit and had to wait |
rate(…[1m]) |
per second, averaged over one minute |
sum by (pod) |
aggregate per pod |
Expected:
["qdrant-2","0.4834710743801653"]
["qdrant-1","0.6357308584686775"]
["qdrant-0","1"]
What you see: qdrant-0 was paused in every period. A search that needs 20 ms of computing time then waits until the next period – hence p50 109 ms and p99 595 ms with zero errors.
Step 4 – where does the limit come from?
# on vdb1
kubectl -n qdrant get statefulset qdrant -o jsonpath='{.spec.template.spec.containers[0].resources}{"\n"}'Expected:
{"limits":{"cpu":"500m","memory":"2Gi"},"requests":{"cpu":"500m","memory":"1Gi"}}
Step 5 – what changed? Argo CD keeps a record of which commit was applied when:
# on vdb1
~/werkbank/bin/argocd app history qdrant --kube-context argocdExpected (excerpt – the source
bibliothek):
ID DATE REVISION
0 2026-12-06 07:08:22 +0000 UTC main (d2c7309)
1 2026-12-06 07:49:10 +0000 UTC main (cd14d03)
# on vdb1
cd ~/bibliothek && git log -3 --format="%h %an %ad %s" --date=format:%H:%M--format="%h %an %ad %s"– short hash, author, date, subject on one line.--date=format:%H:%M– only the time.
Expected:
cd14d03 Mara Kollegin 07:48 Qdrant: CPU-Limit wie Request (Review-Hinweis)
7709e56 Labor vdb1 07:37 Probebau abgebaut
a357511 Labor vdb1 07:33 Probebau: zurück auf Qdrant 1.17.1
Step 6 – revert it, on the plan. A
git revert creates a new commit that reverses exactly this
change – the history stays traceable.
# on vdb1
cd ~/bibliothek && git revert --no-edit cd14d03Expected:
[main 234699a] Revert "Qdrant: CPU-Limit wie Request (Review-Hinweis)"
Date: Sun Dec 6 08:02:52 2026 +0000
1 file changed, 1 deletion(-)
# on vdb1
cd ~/bibliothek && git pushThen, as in the preparation,
argocd app get qdrant --refresh,
argocd app sync qdrant and
argocd app wait qdrant --sync --health --timeout 600 (all
with --kube-context argocd). The rollout took from 08:03:02
to 08:05:44.
Step 7 – proof.
# on vdb1
kubectl -n qdrant get statefulset qdrant -o jsonpath='{.spec.template.spec.containers[0].resources}{"\n"}'Expected:
{"limits":{"memory":"2Gi"},"requests":{"cpu":"500m","memory":"1Gi"}}
# on vdb1
cd ~/labor/tag16 && ~/werkbank/bin/python ../tag11/last-prozesse.py https://10.43.151.237:6333 doku ../tag01/fragen.npy 16 8000Expected:
parallel 16 (Prozesse) · 8000 Anfragen in 20.3 s · 394 Anfragen/s · p50 27.9 ms · p95 59.8 ms · p99 133.9 ms · max 421.3 ms · Fehler 0
394 instead of 64 requests per second. The short run right after the
pods restarted does not reach the 505 from Day 11 – the page caches are
still cold (Day 9). At 08:08 the alert list only showed the
Watchdog; the latency alert had cleared as soon as the slow
minutes had dropped out of the 5-minute window.
Cause: A CPU limit of 500m with 16 parallel readers.
Kubernetes throttles in 100 ms periods; Qdrant notices nothing of this
and reports no error. The default alert CPUThrottlingHigh
(threshold 25 % throttled periods) waits 15 minutes and has only the
severity info; the custom latency alert from Day 11 fired
at most three minutes after the load began.
Remember: Latency without errors means: someone is waiting. If a pod’s CPU sits at a flat value, look for a limit. For latency-critical databases, you set CPU requests but no CPU limit – the memory limit stays.
Solution to Incident 2: the building inspector puts the fault back
Step 1 – situation. “after 1 ms” is not a timeout but an active rejection. That is how the k3s NetworkPolicy controller rejects (Day 10). Is Prometheus affected too?
# on vdb1
curl -sS http://10.43.23.41:9090/api/v1/query --data-urlencode 'query=up{job="qdrant-headless"}' | jq -c '.data.result[] | [.metric.pod, .value[1]]'Expected:
["qdrant-2","1"]
["qdrant-1","1"]
["qdrant-0","1"]
What you see: Prometheus reaches all three pods – it
comes in via the pod label qdrant-zugriff=ja. Only the
workbench is blocked.
Step 2 – what does the policy allow?
# on vdb1
kubectl -n qdrant get networkpolicy leser-und-werkbank -o jsonpath='{.spec.ingress[0].from}{"\n"}'Expected:
[{"namespaceSelector":{},"podSelector":{"matchLabels":{"qdrant-zugriff":"ja"}}},{"ipBlock":{"cidr":"172.16.0.182/32"}}]
Step 3 – with which address does the workbench arrive? Packets from vdb1 into the pod network leave the node via the Flannel interface and carry its address (Day 10):
# on vdb1
ip -4 -brief address show flannel.1-4– IPv4 only;-brief– one line per interface.
Expected:
flannel.1 UNKNOWN 10.42.0.0/32
What you see: The policy allows
172.16.0.182, but the packets come from
10.42.0.0.
Step 4 – the obvious fix. The correct version is still on the workbench from Day 10:
# on vdb1
cd ~/labor/tag16 && kubectl apply -f ../tag10/freigaben.yaml && date +%T.%N | cut -c1-12Expected:
networkpolicy.networking.k8s.io/rat-untereinander configured
networkpolicy.networking.k8s.io/leser-und-werkbank configured
08:07:04.851
The test right afterwards:
# on vdb1
cd ~/labor/tag16 && date +%T && curl -sS --cacert ../tag10/ca.crt -H "api-key: $(cat ../tag10/lese-key)" https://10.43.151.237:6333/collections -o liste.json; echo "Exit-Code $?"Expected:
08:07:05
Exit-Code 0
It works. Half a minute later, the same two checks again:
# on vdb1
kubectl -n qdrant get networkpolicy leser-und-werkbank -o jsonpath='{.spec.ingress[0].from[1]}{"\n"}'Expected (at 08:07:34):
{"ipBlock":{"cidr":"172.16.0.182/32"}}
08:07:37
curl: (7) Failed to connect to 10.43.151.237 port 6333 after 1 ms: Couldn't connect to server
Exit-Code 7
# on vdb1
kubectl -n argocd get application regeln -o jsonpath='{.status.operationState.startedAt} {.status.operationState.message} {.status.sync.status}{"\n"}'Expected:
2026-12-06T08:07:08Z successfully synced (all tasks run) Synced
What you see: The fix lasted four seconds. At
08:07:08, selfHeal brought the policy back to the state in
Git – and Git contains the fault. Anyone who only looks at the cluster
now sees a policy that breaks “by itself”.
Step 5 – find the change in the plan.
# on vdb1
cd ~/bibliothek && git log -2 --format="%h %an %ad %s" --date=format:%H:%M -- regeln-- regeln– only commits that changed something in the folderregeln.
Expected:
bbee54a Mara Kollegin 08:06 Regeln: Werkbank über ihre Knotenadresse freigeben
daefc1e Labor vdb1 06:56 Qdrant-Werte und NetworkPolicies aus Tag 10 und 12
Step 6 – fix it on the plan.
# on vdb1
cd ~/bibliothek && git revert --no-edit bbee54aExpected:
[main 1a40a66] Revert "Regeln: Werkbank über ihre Knotenadresse freigeben"
Date: Sun Dec 6 08:07:47 2026 +0000
1 file changed, 1 insertion(+), 1 deletion(-)
# on vdb1
cd ~/bibliothek && git push# on vdb1
~/werkbank/bin/argocd app get regeln --refresh --kube-context argocdExpected (excerpt, 08:07:48):
Sync Status: OutOfSync from main (1a40a66)
Step 7 – proof, a few seconds later with the same
curl as in the report:
08:07:57
Exit-Code 0
# on vdb1
cd ~/labor/tag16 && cat liste.jsonExpected:
{"result":{"collections":[{"name":"doku"},{"name":"glove"},{"name":"verteilt"}]},"status":"ok","time":0.000048796}
Cause: The allow rule was changed to the node
address, but with Flannel, traffic from the node into the pod network
carries the address 10.42.0.0. The commit looked harmless
in the review.
Remember: Under GitOps, a fix on the cluster is only a stopgap for a few seconds. If the resource belongs to an Application with
selfHeal, only what is fixed in Git stays fixed.
Solution to Incident 3: the new branch from the off-site store
Step 1 – which backups exist?
# on vdb1
~/werkbank/bin/aws --profile qdrant s3 ls --recursive s3://qdrant-sicherung/snapshots/doku/Expected:
2026-12-06 02:28:48 109664256 snapshots/doku/doku-121400021250061-2026-12-06-02-28-41-0.snapshot
2026-12-06 02:37:20 109725696 snapshots/doku/doku-121400021250061-2026-12-06-02-37-15-2.snapshot
2026-12-06 08:08:37 109725696 snapshots/doku/doku-121400021250061-2026-12-06-08-08-30-0.snapshot
2026-12-06 06:54:35 51217408 snapshots/doku/shards/0/doku-shard-0-2026-12-06-06-54-32-3.snapshot
What you see: The most recent backup is the
collection snapshot from 08:08 from peer 121400021250061
(qdrant-0). Because doku has only one shard and qdrant-0
had a copy of it, it contains all points – unlike glove on
Day 12. The shard snapshot from 06:54 would contain no configuration;
without an existing collection you could not restore it.
Step 2 – issue a pickup slip (Day 12):
# on vdb1
cd ~/labor/tag16 && ~/werkbank/bin/aws --profile qdrant s3 presign s3://qdrant-sicherung/snapshots/doku/doku-121400021250061-2026-12-06-08-08-30-0.snapshot --expires-in 900 > doku-url.txt && date +%TExpected:
08:10:01
Step 3 – restore. Via the service, with the admin key:
# on vdb1
cd ~/labor/tag16 && date +%T && curl -sS --cacert ../tag10/ca.crt -H "api-key: $(cat ../tag10/admin-key)" -H "Content-Type: application/json" -X PUT "https://10.43.151.237:6333/collections/doku/snapshots/recover?wait=true" -d "{\"location\":\"$(cat doku-url.txt)\"}"; echo; date +%T| Setting | Value | Meaning |
|---|---|---|
-X PUT |
…/collections/doku/snapshots/recover |
create or replace a collection from a snapshot |
?wait=true |
only respond once restored | |
-d |
{"location": "<url>"} |
where Qdrant fetches the file from – here the pickup slip |
echo; date +%T |
line break after the response, then the end time |
Expected:
08:10:07
{"result":true,"status":"ok","time":6.348361681}
08:10:14
Step 4 – check configuration and copies.
# on vdb1
cd ~/labor/tag16 && curl -sS --cacert ../tag10/ca.crt -H "api-key: $(cat ../tag10/admin-key)" https://10.43.151.237:6333/collections/doku -o doku-neu.json# on vdb1
cd ~/labor/tag16 && jq -c '.result | {status, points_count, rf: .config.params.replication_factor, schema: .payload_schema}' doku-neu.jsonExpected:
{"status":"yellow","points_count":13220,"rf":2,"schema":{"bereich":{"data_type":"keyword","points":13220}}}
# on vdb1
cd ~/labor/tag16 && curl -sS --cacert ../tag10/ca.crt -H "api-key: $(cat ../tag10/admin-key)" https://10.43.151.237:6333/collections/doku/clusterExpected:
{"result":{"peer_id":121400021250061,"shard_count":1,"local_shards":[{"shard_id":0,"points_count":13220,"state":"Active"}],"remote_shards":[{"shard_id":0,"peer_id":1485700002748332,"state":"Active"}],"shard_transfers":[]},"status":"ok","time":0.002379949}
What you see: Qdrant created the collection across
the whole cluster with the configuration from the snapshot – replication
factor 2, payload index on bereich – and created the second
copy right away as well, this time on qdrant-2
(1485700002748332) instead of qdrant-1. To confirm that the
second copy really has data, you ask qdrant-2 directly (IP from
kubectl get pods -o wide):
# on vdb1
cd ~/labor/tag16 && date +%T && curl -sS --resolve qdrant-2.qdrant-headless:6333:10.42.2.27 --cacert ../tag10/ca.crt -H "api-key: $(cat ../tag10/admin-key)" https://qdrant-2.qdrant-headless:6333/collections/doku/clusterExpected:
08:10:29
{"result":{"peer_id":1485700002748332,"shard_count":1,"local_shards":[{"shard_id":0,"points_count":13220,"state":"Active"}],"remote_shards":[{"shard_id":0,"peer_id":121400021250061,"state":"Active"}],"shard_transfers":[]},"status":"ok","time":0.000317089}
At the same time, doku was green with
13,220 indexed vectors (GET /collections/doku, fields
status and indexed_vectors_count).
Step 5 – what is missing? The five points from 08:09:17 and, for comparison, an old point:
# on vdb1
cd ~/labor/tag16 && curl -sS --cacert ../tag10/ca.crt -H "api-key: $(cat ../tag10/lese-key)" -H "Content-Type: application/json" -X POST https://10.43.151.237:6333/collections/doku/points -d '{"ids":[960000,960004,3500],"with_payload":false}'POST …/pointswithids– fetches points by ID; missing IDs are silently absent from the response.
Expected:
{"result":[{"id":3500}],"status":"ok","time":0.005048109}
The times:
| Event | Time |
|---|---|
| snapshot started / finished | 08:08:30 / 08:08:37 |
| five new points written | 08:09:17 |
doku deleted |
08:09:48 |
| error noticed | 08:09:58 |
| pickup slip, restore finished | 08:10:01, 08:10:14 |
both copies there, collection green |
08:10:29 |
RPO: everything after 08:08:30 – here 47 seconds
with 5 points. With a nightly backup it would be up to 24 hours.
RTO: 31 seconds from noticing to green for
13,220 vectors with 768 dimensions (110 MB snapshot), not counting the
time a human needs to think. The application has to rewrite the five
points from its own source.
Cause: Deletion with the admin key, which is allowed to do everything. Qdrant does not ask for confirmation and has no recycle bin.
Remember: A backup only counts once it brings the configuration along and the restore has been rehearsed. After the restore you check three things: point count, configuration and whether every copy has data.
Production readiness checklist
Finally, the acceptance by the building inspector. Every row has a check command that you run individually, and a result that you expect. The table is the overview; below it are the runs on the final state of the lab.
| Item | In the course | Check command | Expected |
|---|---|---|---|
| every shard with two copies | Day 5, 15 | GET /collections/<c> →
replication_factor |
2 for every collection |
| one pod per node | Day 6 | kubectl get sts qdrant -o jsonpath=…topologyKey |
kubernetes.io/hostname |
| at most one pod down as planned | Day 6 | kubectl -n qdrant get pdb |
MAX UNAVAILABLE 1 |
| Raft healthy | Day 7 | GET /cluster |
3 peers, one leader, no send failures |
| storage with headroom | Day 3 | kubectl exec … df -h /qdrant/storage |
well below 80 % |
| volumes healthy | Day 3 | kubectl -n longhorn-system get volumes.longhorn.io |
all healthy |
| requests, no CPU limit | Day 9, 16 | kubectl get sts qdrant -o jsonpath=…resources |
requests set, limit only on memory |
| TLS only | Day 10 | curl http://… |
no plain-text HTTP |
| certificate renews itself | Day 10 | kubectl get certificate |
READY True, renewal before expiry |
| no access without a key | Day 10 | curl without api-key |
401 |
| network closed except for allow rules | Day 10 | kubectl -n qdrant get networkpolicy |
alles-zu + allow rules |
| Pod Security | Day 10 | kubectl get ns qdrant --show-labels |
enforce=restricted |
| metrics arrive | Day 11 | up{job="qdrant-headless"} |
1 for every pod |
| alerts defined | Day 11 | kubectl -n qdrant get prometheusrule |
qdrant-slo |
| regular backups | Day 12 | kubectl -n qdrant get cronjob,
aws s3 ls |
job present, most recent backup younger than the RPO |
| restore rehearsed | Day 12, 16 | Incident 3 | RTO measured |
| state from Git | Day 15 | argocd app list |
Synced, Healthy |
| no orphaned Secrets | Day 15, 16 | kubectl -n qdrant get secrets |
only Secrets in use |
Check 1 – replication. For each collection individually:
# on vdb1
cd ~/labor/tag16 && curl -sS --cacert ../tag10/ca.crt -H "api-key: $(cat ../tag10/lese-key)" https://10.43.151.237:6333/collections/glove -o glove-info.json# on vdb1
cd ~/labor/tag16 && jq -c '.result.config.params | {shard_number, replication_factor}' glove-info.jsonExpected:
{"shard_number":3,"replication_factor":1}
The same for verteilt gives
{"shard_number":3,"replication_factor":2}; for
doku you saw 2 in Incident 3. Not
met: glove has only one copy per shard. That was
intended for the measurements on Day 8 and 9, but it went down during
every rollout on Day 15. In production: increase the replication factor
and have copies created (Day 5) – with the storage that Day 9 calculates
for it.
Check 2 – distribution and PDB.
# on vdb1
kubectl -n qdrant get statefulset qdrant -o jsonpath='{.spec.template.spec.affinity.podAntiAffinity.requiredDuringSchedulingIgnoredDuringExecution[0].topologyKey}{"\n"}'Expected:
kubernetes.io/hostname
# on vdb1
kubectl -n qdrant get pdbExpected:
NAME MIN AVAILABLE MAX UNAVAILABLE ALLOWED DISRUPTIONS AGE
qdrant N/A 1 1 20h
Check 3 – storage.
# on vdb1
kubectl -n qdrant exec qdrant-0 -- df -h /qdrant/storageExpected:
Filesystem Size Used Avail Use% Mounted on
/dev/longhorn/pvc-c6c96e89-073d-4b27-baae-13ed36b72ef8 3.9G 361M 3.5G 10% /qdrant/storage
Enough headroom also for the snapshot archive in
/qdrant/storage/tmp (Day 12).
kubectl -n longhorn-system get volumes.longhorn.io showed
all volumes attached and healthy. You checked
the resources after Incident 1: requests 500m and 1Gi, limit only 2Gi of
memory.
Check 4 – certificate and TLS.
# on vdb1
kubectl -n qdrant get certificateExpected:
NAME READY SECRET AGE
qdrant-ca True qdrant-ca 7h42m
qdrant-tls True qdrant-tls 7h42m
# on vdb1
kubectl -n qdrant get certificate qdrant-tls -o jsonpath='{.status.notAfter} {.status.renewalTime}{"\n"}'Expected:
2027-03-06T00:28:56Z 2027-02-19T00:28:56Z
cert-manager renews 15 days before expiry.
# on vdb1
curl -sS -m 5 http://10.43.151.237:6333/collections; echo "Exit-Code $?"-m 5– give up after five seconds at most.
Expected:
curl: (1) Received HTTP/0.9 when not allowed
Exit-Code 1
Plain-text HTTP only gets TLS bytes back, which curl
does not understand as HTTP.
Check 5 – without a key.
# on vdb1
cd ~/labor/tag16 && curl -sS --cacert ../tag10/ca.crt -o /dev/null -w "%{http_code}\n" https://10.43.151.237:6333/collections-o /dev/null– discard the response;-w "%{http_code}\n"– output only the HTTP status.
Expected:
401
Check 6 – network and Pod Security.
# on vdb1
kubectl -n qdrant get networkpolicyExpected:
NAME POD-SELECTOR AGE
alles-zu <none> 7h29m
leser-und-werkbank app.kubernetes.io/name=qdrant 57m
rat-untereinander app.kubernetes.io/name=qdrant 7h28m
# on vdb1
kubectl get namespace qdrant --show-labelsExpected (column LABELS):
kubernetes.io/metadata.name=qdrant,name=qdrant,pod-security.kubernetes.io/enforce-version=v1.37,pod-security.kubernetes.io/enforce=restricted
Check 7 – monitoring. You queried
up{job="qdrant-headless"} in Incident 2: 1 for all three
pods.
# on vdb1
kubectl -n qdrant get prometheusruleExpected:
NAME AGE
qdrant-slo 6h56m
Check 8 – backup.
# on vdb1
kubectl -n qdrant get cronjobExpected:
No resources found in qdrant namespace.
Not met: You triggered every backup in the off-site store by hand; the most recent is the one from Incident 3. A scheduled job that triggers a snapshot for every shard at a peer with a copy and reports the result is missing – it has to avoid exactly the trap from Day 12, where a snapshot via the service hits the wrong peer. This includes an alert when the most recent backup is older than the RPO.
Check 9 – GitOps and version.
# on vdb1
~/werkbank/bin/argocd app list --kube-context argocdExpected (shortened on the right):
NAME CLUSTER NAMESPACE PROJECT STATUS HEALTH SYNCPOLICY CONDITIONS
argocd/qdrant https://kubernetes.default.svc qdrant default Synced Healthy Manual <none>
argocd/regeln https://kubernetes.default.svc qdrant default Synced Healthy Auto <none>
# on vdb1
kubectl -n qdrant get statefulset qdrant -o jsonpath='{.spec.template.spec.containers[0].image}{"\n"}'Expected:
docker.io/qdrant/qdrant:v1.20.3
Check 10 – orphaned Secrets.
# on vdb1
kubectl -n qdrant get secretsExpected:
NAME TYPE DATA AGE
prometheus-lesen Opaque 1 7h3m
qdrant-ca kubernetes.io/tls 3 7h42m
qdrant-s3 Opaque 2 5h45m
qdrant-schluessel Opaque 2 7h55m
qdrant-tls kubernetes.io/tls 3 7h42m
qdrant-zugang Opaque 2 67m
Nobody has used qdrant-schluessel from Day 10 since Day
15. First check whether the StatefulSet mentions it:
# on vdb1
kubectl -n qdrant get statefulset qdrant -o yaml | grep -c qdrant-schluesselExpected:
0
grep -c counts the matches: none (the exit code is then
1). So away with it – a Secret that nobody needs can only be stolen:
# on vdb1
kubectl -n qdrant delete secret qdrant-schluesselExpected:
secret "qdrant-schluessel" deleted from qdrant namespace
The read key keeps working (curl … -w "%{http_code}\n"
with api-key returned 200).
Result of the acceptance: 16 of 18 items met. Still
open are the second copy for glove and the scheduled
backup. In addition there are items that the lab deliberately leaves out
(see Enterprise note): Prometheus only stores in an
emptyDir, the admin key may delete everything, and there is
only one off-site store, on the same machine as the workbench.
Remember: Production-ready is what a command proves. A checklist without check commands is a wish list – and an honest acceptance always finds something.
Taking down the lab
When you no longer need the lab, you take it down in reverse order. The commands here are for reference; in the author’s lab everything stays in place. Where possible, they were checked with a dry run.
Argo CD first, otherwise it restores deleted policies. The Applications have no finalizer:
# on vdb1 kubectl -n argocd get application qdrant regeln -o custom-columns=NAME:.metadata.name,FINALIZER:.metadata.finalizersExpected:
NAME FINALIZER qdrant <none> regeln <none>Without a finalizer,
kubectl -n argocd delete application qdrant regelnonly deletes the Applications; Qdrant keeps running. Thenhelm uninstall argocd -n argocd. Caution with the dry run: Helm 4 reports “release”argocd” uninstalled” even with--dry-run–helm list -n argocdstill showeddeployedafterwards. The three Argo CD CRDs remain (“kept due to the resource policy”).Qdrant and its data:
kubectl delete namespace qdrantalso deletes the PVCs. The StorageClasslonghornhasreclaimPolicy: Delete(kubectl get storageclass longhorn -o jsonpath="{.reclaimPolicy}"), so the volumes disappear with it. The dry run with--dry-run=clientreportednamespace "qdrant" deleted (dry run).Monitoring and cert-manager:
helm uninstall monitoring -n monitoringandhelm uninstall cert-manager -n cert-manager(releases according tohelm list -A).Off-site store:
sudo systemctl disable --now aussenlageron vdb1 (the service isenabled), then delete/srv/aussenlager– only once you no longer need any backup.k3s: on vdb2, vdb3 and vdb4
sudo /usr/local/bin/k3s-agent-uninstall.sh, finally on vdb1sudo /usr/local/bin/k3s-uninstall.sh. Both scripts have been there since Day 0. They do not remove Longhorn’s data under/var/lib/longhorneither – you delete that by hand.
Checkpoint
# on vdb1
cd ~/labor/tag16 && curl -sS --cacert ../tag10/ca.crt -H "api-key: $(cat ../tag10/admin-key)" https://10.43.151.237:6333/cluster -o cluster-ende.json# on vdb1
cd ~/labor/tag16 && jq -c '{peers: (.result.peers|length), raft: .result.raft_info, fehler: .result.message_send_failures}' cluster-ende.jsonExpected:
{"peers":3,"raft":{"term":343,"commit":242,"pending_operations":0,"leader":857928665674298,"role":"Follower","is_voter":true},"fehler":{}}
# on vdb1
cd ~/labor/tag16 && jq -c '.result | {status, points_count}' glove-info.jsonExpected:
{"status":"green","points_count":1183514}
In addition, doku with 13,220 points
(POST …/points/count with {"exact":true}),
both Argo CD Applications Synced and Healthy,
all Longhorn volumes healthy and only the
Watchdog in the alert list.
Test yourself
- A latency alert fires, the error rate is 0, no pod restarts. Which two causes from this course do you check first, and with which command?
- Why is
kubectl topwith a flat value like 499m a hint at a limit? - You fix a NetworkPolicy with
kubectl apply, and four seconds later nothing works again. What happened, and where does the fix belong? - Why could Prometheus still reach the pods in Incident 2, but the workbench could not?
- Which backup do you need when a collection has been deleted – collection or shard snapshot – and why?
- After the restore,
points_countis correct. What else do you check?
Answers:
- CPU throttling (
kubectl top pods, rate ofcontainer_cpu_cfs_throttled_periods_total) and too little memory with page cache eviction (Day 9: the pod’s memory and waiting processes on the node). And always: what changed (argocd app history,git log)? - Real load fluctuates. A value that stays just below a round number is the ceiling set by the CPU limit – the kernel then pauses the container in every 100 ms period.
- The policy belongs to an Argo CD Application with
selfHeal. Argo CD reset it to the state in Git – and Git contains the fault. Fix it withgit revertand a push. - The allow rule has two parts: pods with the label
qdrant-zugriff=ja(Prometheus) and an IP block for the workbench. Only the IP block was wrong; the workbench arrives with the Flannel address10.42.0.0. - A collection snapshot that contains all shards: it brings the configuration along and creates the collection anew during the restore. A shard snapshot needs an existing collection. With several shards with one copy each, the snapshot of one peer is not enough (Day 12).
- Configuration (dimension, distance, replication factor, payload
indexes), status
green, and whether every copy has data (/collections/<c>/clusterat every peer). And which points arrived after the backup – that is the RPO.
Interview note
“Tell me about an incident with a vector database.” – Search
became eight times slower without a single error. The pods’ CPU sat at a
flat 499m: a commit had set the CPU limit equal to the request, and the
kernel throttled qdrant-0 in every period. I proved this with the
throttling rate from Prometheus and reverted the commit with
git revert. Since then I set CPU requests for Qdrant, but
no CPU limit. A second case: a policy fix on the cluster lasted four
seconds because Argo CD with selfHeal restored the fault
from Git. For a deleted collection, I restored from a collection
snapshot in S3 – 31 seconds to green, everything after the
backup was lost – and then checked that both copies had data again.
Enterprise note
In operations, every alert has a runbook with the first three commands and a link to the dashboard, an on-call rotation with escalation levels, and after every incident a blameless postmortem with concrete actions. The open items from the acceptance belong there: replication factor 2 for all collections, a scheduled backup per shard with an alert on its age, an off-site store at a second location with versioning and object lock, Prometheus with a volume and longer retention.
Against slips like in Incident 3, permissions help, not caution:
applications get JWTs only for their collections (Day 10), only
automation uses the admin key, and deletions go through a commit with
review. Against Incidents 1 and 2, a policy in the pipeline helps – for
example Kyverno or conftest, rejecting CPU limits in the
namespace qdrant and allowing IP blocks in policies only
from a list. And game days like this chapter belong in the calendar, not
just in training.
Summary
- Incident 1: CPU limit 500m via commit. 64 instead of 505 requests/s,
p99 595 ms, 0 errors; qdrant-0 throttled in every period.
QdrantSucheZuLangsamfired,CPUThrottlingHighwas stillpending. Solutiongit revert, afterwards 394 requests/s with cold caches. - Incident 2: workbench allow rule changed to
172.16.0.182/32, but the workbench arrives with10.42.0.0.kubectl applyof the correct policy lasted four seconds, thenselfHealrestored the fault from Git. Solutiongit revertand--refresh; access again after nine seconds. - Incident 3:
dokudeleted with the admin key. Collection snapshot from 08:08 restored via pickup slip: configuration, payload index and second copy came along. RTO 31 s togreen, RPO 47 s with five points. - Acceptance: 16 of 18 items; still open are replication factor 1 for
gloveand a scheduled backup.qdrant-schluesseldeleted. - With
helm uninstall --dry-run, Helm 4 reports “uninstalled” without uninstalling anything.
Commands at a glance
| Command | Purpose |
|---|---|
git apply --check <patch> /
git apply <patch> |
check / apply a patch |
git commit -a --author="Name <mail>" -m "…" |
commit with a different author |
git log -3 --format="%h %an %ad %s" --date=format:%H:%M [-- <path>] |
latest changes in compact form, optionally only for one path |
git revert --no-edit <commit> |
revert a change with a new commit |
argocd app history <app> |
which commit was applied when |
kubectl top pods |
current CPU and memory usage |
rate(container_cpu_cfs_throttled_periods_total[1m]) / rate(container_cpu_cfs_periods_total[1m]) |
share of throttled periods |
curl …/api/v1/alerts -o alarme.json |
Prometheus alert list |
ip -4 -brief address show flannel.1 |
the node’s source address in the pod network |
kubectl get application <app> -o jsonpath='{.status.operationState.startedAt}' |
when Argo CD last applied |
curl -X PUT …/collections/<c>/snapshots/recover -d '{"location":"<url>"}' |
recreate a collection from a snapshot |
curl -X POST …/collections/<c>/points -d '{"ids":[…]}' |
query points by ID |
curl -o /dev/null -w "%{http_code}\n" … |
output only the HTTP status |
kubectl get certificate <name> -o jsonpath='{.status.notAfter}' |
expiry of a certificate |
kubectl delete namespace <ns> --dry-run=client |
trial deletion |