Restart count
Rising means the kubelet is restarting the container. A pod that is merely not ready has no restarts and a different fix.
The pod is in CrashLoopBackOff, the dashboard is red, and the fastest-looking action is to delete the pod. That also deletes the previous container's logs and the terminated state that explains why it died. The restart count and the exit code tell you which of several unrelated problems you have before you touch anything.
This page is free. It covers how to read the last termination, why 137 and 143 point at different owners, and how probes, limits and grace periods turn a slow start into a restart loop.
Rising means the kubelet is restarting the container. A pod that is merely not ready has no restarts and a different fix.
lastState.terminated carries the exit code, the reason and the signal. It survives restarts until the pod is deleted, which is why deleting is a last step.
The kubelet restarts with exponential backoff up to a cap. A long backoff means the container has already failed many times, not that it is waiting for a resource.
Exit 137 is a SIGKILL, usually the kernel OOM killer or a grace period that ran out. Exit 143 is a SIGTERM, usually a probe, a drain or a rollout.
| Command or view | What it tells you |
|---|---|
| kubectl get pods -o wide | Status, restarts, age and node. A single node with many failures is a node problem, not an app problem. |
| kubectl describe pod "$POD" | sed -n '/Last State/,/Ready/p' | The last termination reason and exit code, plus the events for probe failures and OOM kills. |
| kubectl logs "$POD" --previous --tail=100 | The output of the container that died. Without --previous you read the new container, which may not have logged anything yet. |
| kubectl get pod "$POD" -o jsonpath='{range .status.containerStatuses[*]}{.name}{" "}{.restartCount}{" "}{.lastState.terminated.exitCode}{" "}{.lastState.terminated.reason}{"\n"}{end}' | The structured version of the same facts, usable in a script or an alert payload. |
| kubectl get events --field-selector involvedObject.name="$POD" --sort-by=.lastTimestamp | The order of events: image pull, probe failure, kill, restart. Order rules out causes that look plausible. |
| kubectl get pod "$POD" -o jsonpath='{.spec.containers[*].resources}' | Requests and limits. A limit equal to the observed working set makes an OOM kill a matter of time. |
| kubectl top pod "$POD" --containers | Current usage against the limit, where the metrics server is installed. Absence of metrics is not evidence of low usage. |
| # | Failure mode | What you see | What to do |
|---|---|---|---|
| 1 | Exit 137 read as "out of memory" | The reason says Error, not OOMKilled, and the shutdown took exactly the grace period. | Check terminationGracePeriodSeconds against the real shutdown time before raising the memory limit. |
| 2 | A liveness probe that outruns startup | Exit 143 shortly after start, events show Liveness probe failed, and the app logs a normal boot in progress. | Add a startup probe or raise the initial delay so liveness only begins after the app is serving. |
| 3 | A memory limit below the working set | Exit 137 with reason OOMKilled, often after a period of stable traffic. | Set the limit from observed p99 usage with headroom, and check runtime heap settings that ignore the container limit. |
| 4 | Entrypoint or image drift | Exit 127 (command not found) or exit 1 before any application log line. | Pin the image by digest and verify the command in the manifest rather than relying on the image default. |
| 5 | Missing configuration at boot | Exit 1 with a validation error, or the pod never starts and reports CreateContainerConfigError. | Distinguish a kubelet configuration failure from an application failure; the first never runs your process. |
| 6 | A dependency that is still down | Every replica crashes at the same second after a deploy, with connection errors in the previous logs. | Add bounded startup retries, and check the dependency before scaling or restarting the workload. |
| 7 | Deleting the pod destroys the evidence | The new pod has a new name, empty previous logs and no terminated state to inspect. | Capture describe, --previous logs and events before any delete or rollout undo. |
| Decision | Question to answer |
|---|---|
| Probes | Does readiness describe traffic, liveness describe a hung process, and startup cover the slow boot? |
| Resources | Are requests and limits based on measured usage, and does the runtime know the container limit? |
| Grace | Is the grace period longer than the real shutdown path, and does the app handle SIGTERM? |
| Evidence | Are previous logs and events shipped somewhere before the pod is replaced? |
| Alerting | Does the alert fire on restart rate and on backoff duration, not only on the pod being not ready? |
Lower a limit below the working set and confirm the reason is OOMKilled, not a probe failure, and that the alert names the container.
Add a startup delay longer than the liveness initial delay and confirm the pod no longer loops once a startup probe is in place.
Remove a required key and confirm the failure is a configuration error rather than a crash loop, so the alert routes to the right owner.
Scale down under load and confirm the process exits on SIGTERM within the grace period, with no 137 in the terminated state.
It will usually produce a new set of pods with the same bug, and it discards the terminated state you needed. Read the previous logs and the exit code first; restart only after you have the cause or a fix.
That is the kubelet's exponential restart delay with a cap. It is protecting the node from a crash loop, and it means the container has failed repeatedly. Fixing the cause resets the pattern on the next successful run.
No. 137 means the process received SIGKILL. The kernel OOM killer is one source; the kubelet sending SIGKILL after the grace period expires is another. The reason field and the timing tell them apart.
That is a readiness problem, not a crash loop. The container is running and the service is withholding traffic. Check the readiness probe, its threshold and the endpoint state before looking at exit codes.
The paid runbooks cover the surrounding failures: deprecation windows that remove an API under you, cache rules that hide a deploy, and production defaults that only bite on a real domain.
This page is free, no checkout. Paid runbooks are $9.99 each and covered by the 7-day refund policy at /runbooks/refund.