Confirm the symptom
kubectl get pods -n <namespace>Is the pod repeatedly restarting, and is the restart count increasing?
A production-focused workflow for diagnosing a Kubernetes container that repeatedly starts, crashes, and gets restarted. Use pod state, exit codes, logs, events, probes, configuration, and resource evidence to identify the actual root cause.
CrashLoopBackOff is a Kubernetes status that indicates a container has repeatedly terminated and Kubernetes is backing off before attempting another restart.
The key troubleshooting principle is: CrashLoopBackOff is a symptom, not the root cause. Your job is to find out why the container is terminating.
Think like an SRE
Do not immediately delete or restart the pod. First capture evidence, determine customer impact, identify the failing layer, apply the smallest safe change, and then verify that the service remains healthy.
Follow this order during an incident. It keeps the investigation evidence-driven instead of changing multiple things at once.
kubectl get pods -n <namespace>Is the pod repeatedly restarting, and is the restart count increasing?
kubectl describe pod <pod-name> -n <namespace>What are State, Last State, Reason, Exit Code, probes, and Events telling you?
kubectl logs <pod-name> -n <namespace> --previousWhat happened immediately before the previous container exited?
kubectl get events -n <namespace> --sort-by=.lastTimestampIs this an application, configuration, probe, resource, mount, or platform issue?
kubectl rollout status deployment/<deployment-name> -n <namespace>Can you correct the underlying cause without making unrelated production changes?
kubectl get pods -n <namespace>Is the pod Ready, stable, and no longer accumulating restarts?
Start by identifying the affected pod and checking whether the restart count is increasing.
kubectl get pods -n <namespace>NAME READY STATUS RESTARTS
my-app-7d8f9c6b7d-abc12 0/1 CrashLoopBackOff 5A pod in CrashLoopBackOff is not necessarily telling you why the process failed. Treat STATUS as the starting signal and continue to the container state, logs, and events.
kubectl describe pod <pod-name> -n <namespace>Shows the current container state. It helps establish what is happening right now.
Often more useful for CrashLoopBackOff because it describes the previous terminated container instance.
Look for evidence such as OOMKilled or another termination reason. Do not infer the cause from the CrashLoopBackOff label alone.
Provides a clue about how the process terminated. Always correlate the exit code with logs and the termination reason.
Application logs are often the fastest route to the actual failure.
kubectl logs <pod-name> -n <namespace>kubectl logs <pod-name> -n <namespace> --previousIf the container has already restarted, the previous instance may contain the final application error that caused the termination.
Events can expose Kubernetes-level problems that do not appear in application logs.
kubectl get events -n <namespace> --sort-by=.lastTimestampAlso check the Events section returned by:
kubectl describe pod <pod-name> -n <namespace>The process starts and exits because of an application exception, invalid startup configuration, missing dependency, or an intentional non-zero exit.
Evidence
kubectl logs or kubectl logs --previous usually contains the application error.
Environment variables, command-line arguments, ConfigMaps, Secrets, or mounted configuration files contain invalid or missing values.
Evidence
Logs show configuration errors, or describe reveals incorrect environment/configuration references.
Kubernetes can restart a container when its liveness probe repeatedly fails. A startup probe can also prevent normal probe evaluation until startup succeeds.
Evidence
describe pod and Events commonly show repeated probe failures.
The container exceeded its memory limit and was terminated. This is different from simply seeing a generic CrashLoopBackOff status.
Evidence
describe pod shows a previous termination reason such as OOMKilled.
The image starts with a command or argument that does not exist, is invalid, or causes the process to terminate immediately.
Evidence
Container logs, pod configuration, and the image's expected startup command are the first places to investigate.
The application expects a file, volume, Secret, ConfigMap, certificate, or permission that is unavailable inside the container.
Evidence
Application logs, describe output, and mount-related events can reveal the missing dependency.
Exit codes are clues, not standalone root-cause answers. Always correlate them with Last State, Reason, logs, and events.
The process exited successfully. If the workload is expected to stay running, investigate why the application exits instead of remaining a long-running process.
A generic application error. Treat the application logs as the primary evidence rather than assuming Kubernetes itself caused the failure.
The process was terminated with SIGKILL (128 + 9). In Kubernetes, check Last State and the termination reason for evidence of OOMKilled before concluding that memory pressure was the cause.
The process was terminated with SIGTERM (128 + 15). Investigate why termination was requested, including workload lifecycle events and graceful shutdown behavior.
A common production mistake is changing probe settings without first checking whether the application actually starts correctly.
Gives a slow-starting application time to initialize before normal liveness/readiness behavior becomes relevant.
Investigate repeated startup failures and whether the configured startup window matches the application's actual startup time.
Helps Kubernetes determine whether a running container should be restarted.
If liveness failures appear in Events, verify the endpoint, port, timing, and application's real health behavior before changing thresholds.
kubectl describe pod <pod-name> -n <namespace>OOMKilled describes a memory-related termination. CrashLoopBackOff describes the resulting repeated restart condition. A pod can show CrashLoopBackOff after a container is repeatedly terminated for memory reasons.
kubectl describe pod <pod-name> -n <namespace>Check the container's Last State and Reason. If the evidence shows OOMKilled, investigate memory limits, actual workload usage, recent application changes, and whether the process has a memory-growth problem before simply increasing the limit.
If logs point to missing or invalid configuration, inspect the workload configuration instead of repeatedly restarting the pod.
kubectl get deployment <deployment-name> -n <namespace> -o yamlkubectl get configmap <configmap-name> -n <namespace> -o yamlkubectl get secret <secret-name> -n <namespace> -o yamlAvoid exposing Secret values in tickets, screenshots, terminal captures, or incident documentation.
Avoid using pod deletion or arbitrary restarts as the first troubleshooting step. Restarting can destroy useful evidence and may temporarily hide the underlying problem.
Recovery is not complete just because the pod briefly becomes Running. Verify readiness, restart stability, workload rollout, and recent events.
kubectl get pods -n <namespace>kubectl describe pod <pod-name> -n <namespace>kubectl logs <pod-name> -n <namespace> --tail=100kubectl get events -n <namespace> --sort-by=.lastTimestampkubectl rollout status deployment/<deployment-name> -n <namespace>1. Confirm
kubectl get pods
2. Describe
State + Last State + Reason + Exit Code + Events
3. Logs
kubectl logs --previous
4. Classify
App / Config / Probe / Resource / Mount / Platform
5. Fix
Change the underlying cause, not just the symptom
6. Verify
Ready + stable restarts + healthy rollout
Usually no. CrashLoopBackOff describes a repeated restart condition and back-off behavior. The underlying cause may be an application error, configuration problem, failed probe, resource termination, or another container startup issue.
Start with kubectl get pods -n <namespace> to confirm the affected pod and restart count. Then use kubectl describe pod and kubectl logs --previous to collect evidence.
A container in CrashLoopBackOff may terminate and restart quickly. --previous lets you inspect logs from the previous container instance, which can contain the failure that caused the restart.
No. OOMKilled is only one possible cause. Check Last State and Reason in kubectl describe pod and correlate them with logs and events.