Incident response and postmortems
An incident goes better with named roles, a severity that sets the pace, and mitigation before diagnosis. Afterwards a blameless postmortem turns the outage into owned fixes.
Shows the lesson one block at a time. Arrow keys step, number keys jump to a scene, and Escape returns to the page where you were.
Incidents are rarely lost for lack of technical skill. They are lost when five people change the system at once, when nobody tells customers what is happening, or when the team spends an hour finding the root cause while users wait. Incident response is the set of habits that prevents that, and the postmortem is how the next incident gets shorter.
Reconcile, in 6 scenes
Severity levels
A severityA level, usually SEV1 to SEV3, chosen by user impact, that sets who is paged, how often updates go out and how urgent the work is. is declared early and changed freely as facts arrive. Over-declaring costs a few interrupted people; under-declaring costs the response.
| Level | Typical impact | Response |
|---|---|---|
| SEV1 | A core function down or data at risk for many users | Page on-call and an incident commander immediately; status updates every 30 minutes; all other work stops |
| SEV2 | Degraded or partial outage, or a SEV1 contained by a workaround | Page on-call; updates every hour; fix within the day |
| SEV3 | Minor or internal impact, no SLO at risk | Ticket; handled in working hours |
The exact thresholds belong to each organization. What matters is that they are written down in terms of user impact, so the person on call does not have to decide alone how bad “bad” is.
Roles
Google’s incident management, modelled on the Incident Command System, separates four jobs:
- The incident commanderThe person who holds the overall state of an incident, assigns roles and makes decisions. They hold every role they have not delegated. keeps the big picture and decides. In a large incident they do not type commands.
- The operations lead and their team are the only people changing the system, so two fixes never collide.
- The communications lead posts regular updates to stakeholders and customers, on the cadence the severity set.
- The planning role supports operations with longer-term work: filing follow-up bugs, arranging handoffs and tracking every temporary change that must be reverted.
The commander also keeps a living incident document: what is known, who holds which role, and a timestamped log of actions. Many teams give the typing to a scribe, and that log becomes the postmortem’s timeline. In a small incident one person holds several roles. The handoff is explicit: “you have command” is said out loud and acknowledged, and so is the end of the incident.
Mitigate first
The first goal is to stop the user impact, not to understand it. Roll back the change that preceded the symptoms, scale out, fail over to another region, or turn off a feature flag, then investigate with the pressure off. A Deployment keeps its previous ReplicaSets, so a bad rollout is one command away from being undone:
kubectl -n shop set image deployment/checkout checkout=ghcr.io/kx-labs/web:1.2-broken
deployment.apps/checkout image updated
kubectl -n shop get pods
NAME READY STATUS RESTARTS AGE checkout-78bbb85fbb-4zlwf 0/1 CrashLoopBackOff 2 (18s ago) 35s checkout-78bbb85fbb-w7tll 0/1 CrashLoopBackOff 3 (1s ago) 40s checkout-dfc847bf9-2cv2c 1/1 Running 0 60s checkout-dfc847bf9-tfgs5 1/1 Running 0 60s
kubectl -n shop rollout history deployment/checkout
deployment.apps/checkout REVISION CHANGE-CAUSE 1 <none> 2 <none>
kubectl -n shop rollout undo deployment/checkout
deployment.apps/checkout rolled back
kubectl -n shop rollout status deployment/checkout
Waiting for deployment "checkout" rollout to finish: 1 old replicas are pending termination... deployment "checkout" successfully rolled out
kubectl -n shop get deployment checkout -o jsonpath='{.spec.template.spec.containers[0].image}'
ghcr.io/kx-labs/web:1.1
The rolling update stalled part-way. With no readiness probe, each new pod counted as ready for the second it ran before crashing, long enough for the Deployment to retire one old replica, so two old pods were left serving all the traffic. A readiness probe that the broken build fails would have held all three. Rollback removed the crashing pods and returned the Deployment to a clean state.
Capture evidence while mitigating, because Kubernetes does not keep it. Events are deleted after one hour by default (the API server’s --event-ttl), the logs of a replaced container are gone once its pod is deleted, and kubectl logs --previous reaches back only one restart. Save kubectl get events, kubectl describe and logs into the incident channel early.
On-call health
People who are paged constantly stop reading pages. Google’s SRE book caps on-call at 25% of an engineer’s time, which takes at least eight people for a single-site rotation with a primary and a secondary, and sets two incidents per 12-hour shift as the most anyone can handle well, given about six hours of response and follow-up each. Healthy on-call has a written handoff at each shift change, a review of every page (was it actionable, was it urgent), and the authority to delete alerts that are neither.
Paging and incident tooling sits on top: PagerDuty, incident.io, Grafana IRM or Jira Service Management. Atlassian ended Opsgenie sales on June 4, 2025 and ends its support on April 5, 2027, moving its users to Jira Service Management or Compass.
Runbooks and playbooks
A runbook is written for someone woken at 3 a.m. who has never seen the alert. Each step gives the exact command, what output means “fine”, and what to do otherwise. Write the expected output from a real run, not from memory:
kubectl -n shop rollout restart deployment/checkout
deployment.apps/checkout restarted
kubectl -n shop rollout status deployment/checkout
Waiting for deployment "checkout" rollout to finish: 1 out of 3 new replicas have been updated... Waiting for deployment "checkout" rollout to finish: 2 out of 3 new replicas have been updated... Waiting for deployment "checkout" rollout to finish: 1 old replicas are pending termination... deployment "checkout" successfully rolled out
kubectl -n shop get deployment checkout
NAME READY UP-TO-DATE AVAILABLE AGE checkout 3/3 3 3 24s
rollout restart returns at once: it only patches an annotation on the pod template. rollout status is the step that waits, and it exits non-zero if the Deployment passes its progress deadline, which makes it safe to script. A good runbook entry also says when to stop following it and escalate.
Blameless postmortems
Google’s SRE book lists the usual triggers for a postmortem: user-visible downtime or degradation beyond a threshold, any data loss, an on-call intervention such as a rollback or traffic reroute, a resolution time above a threshold, and a monitoring failure that left humans to discover the problem. A postmortem has:
- Impact: who was affected, how much, for how long, and how much error budget it spent.
- Timeline: timestamps from the trigger through detection, mitigation and resolution, built from the incident document, chat logs and deploy history.
- Contributing factors: the conditions that together allowed the outage. There is rarely a single root cause.
- What went well, what went poorly, where we got lucky: luck is a factor that will not be there next time.
- Action items: each with one owner, a priority and a due date, tracked in the normal bug tracker.
blameless postmortemA review that assumes everyone acted reasonably on the information they had, and looks for the system conditions that made the failure possible rather than for someone to blame. writing is what keeps people reporting their own mistakes. “The engineer ran the wrong command” invites punishment and changes nothing. “The tool ran the command against production without a confirmation or a diff” names something that can be fixed. Postmortems are reviewed, shared widely and kept searchable, so the same lesson is not learned twice.
kubectl --context kind-kx create deployment checkout --image=nginx:1.30 --replicas=3kubectl --context kind-kx set image deployment/checkout nginx=nginx:1.300kubectl --context kind-kx get pods -l app=checkoutkubectl --context kind-kx rollout undo deployment/checkoutkubectl --context kind-kx rollout status deployment/checkoutkubectl --context kind-kx delete deployment checkout
For your own kind cluster kx: copy a command and paste it into your terminal. Run in the simulator runs the same command in this page's simulated cluster instead; nothing on this page touches your machine. The new pod stays in ImagePullBackOff while the three old pods keep serving; rollout undo returns the Deployment to nginx:1.30.
Actual state
Check your understanding
Your first answer to each check is the one that counts. After a miss you can answer again; passing every check reconciles the lesson.
Lesson not yet reconciled
Desired: 4 objectives, 0 metReconciled: 4 of 4 objectives met
- Run an incident with clear roles: incident commander, operations and communications. (not yet met)
- Pick a severity and say what it changes about the response. (not yet met)
- Write a blameless postmortem with a timeline, contributing factors and owned actions. (not yet met)
- Write a runbook a tired responder can follow. (not yet met)
Pass every check above to reconcile this lesson.
Every check has passed, so the desired state is met. First-try accuracy: 0 of 5. This lesson's review cards are in your queue.
Changed since the notes
This lesson draws on an earlier set of study notes. Where the documentation contradicts a claim in them, qualifies it or has moved past it, the claim is listed here with the corrected statement and the source it was checked against.
Show 3 corrections
The notes saidIncident management platforms like PagerDuty, Opsgenie, or incident.io orchestrate response.
CorrectedAtlassian ended Opsgenie sales on June 4, 2025 and ends support on April 5, 2027 (unmigrated data is deleted then). Opsgenie customers move to Jira Service Management (incident management) or Compass (alerting/on-call). Name PagerDuty, incident.io, Grafana IRM or Jira Service Management instead of Opsgenie.
Sourceatlassian.com/blog/announcements/evolution-of-it-operations
The notes saidPaging systems: PagerDuty, Opsgenie, and similar tools.
CorrectedSame as note 64: Opsgenie is end-of-sale (June 4, 2025) and end-of-support (April 5, 2027); its on-call/alerting functions move to Jira Service Management or Compass.
Sourceatlassian.com/blog/announcements/evolution-of-it-operations
The notes saidExpected output 'Deployment restarted successfully' for kubectl rollout restart.
Corrected
kubectl rollout restart deployment/api -n productionprintsdeployment.apps/api restarted(the printer operation is 'restarted'). It only patches the pod template annotation; verify completion withkubectl rollout status deployment/api -n production, which ends withdeployment "api" successfully rolled outand exits non-zero if the progress deadline is exceeded.
Every correction across the guide, by note and topic.
Sources
Checked against kubernetes.io and the Google SRE books for Kubernetes 1.37 on .
- sre.google/sre-book/managing-incidents
- sre.google/sre-book/postmortem-culture
- sre.google/sre-book/being-on-call
- sre.google/workbook/incident-response
- sre.google/workbook/postmortem-culture
- sre.google/workbook/on-call
- kubernetes.io/docs/reference/kubectl/generated/kubectl_rollout/kubectl_rollout_undo
- kubernetes.io/docs/reference/kubectl/generated/kubectl_rollout/kubectl_rollout_restart
- kubernetes.io/docs/concepts/workloads/controllers/deployment
- kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver
Incident response and postmortems
↓ ↑ step, 1 to 6 scene, Esc leave