DevOps · post-mortem
9am. Everything is green. Who crashed last night?
On-call prepares the post-mortem.
kubectl only shows the present.
Demo kind cluster
The problem
Kubernetes erases its events after one hour.
- A repaired pod is a new pod: 0 restarts.
- Its Warning events expire.
- The post-mortem's question has no answer left in the cluster.
The lab
Two deployments crash in a loop.
- payment-api is repaired.
- billing-api still crashes.
- The cluster forgets its events in 3 minutes instead of one hour.
What had to be written
unique_key: $.metadata.uid
cells["workload_key"] =
"$namespace/$deployment"One key per event, one per deployment.
The hub keeps every event it read. The scenario: 3 files, 69 lines.
After the forgetting
kubectl: No resources found.
- payment-api: Running, 0 restarts.
- The second run reads one event out of two.
The answer
"Quels déploiements ont eu un événement BackOff?"
- payments/payment-api, forgotten by the cluster.
- billing/billing-api, still failing.
The proof
The kubectl witness is taken during the incident.
- Same list, or the scenario fails.
- 6 times out of 6, the same two deployments.
Try it
The scenario replays on kind.
One connector, one script, one entity, one question: every step is published with its output.