This article describes the reasons that may cause a Pod to fail and enter the CrashLoopBackOff status and how to troubleshoot the issues. Refer to the following instructions to troubleshoot and solve these issues.
If a Pod’s status is
CrashLoopBackOff, this means the Pod was launched but exited with exceptions. When this happens, unless the Pod’s restartPolicy is
Never, the Pod will be restarted and the
RestartCounts of the Pod will usually be greater than 0. In this case, first see Using Exit Code to Troubleshoot Pod Exiting with Exceptions for information on using the exit code to narrow down the range of possible problems.
When a container exits, the exit code usually is between 0 and 128. The cause of the exception may be a bug or other reason.
Refer to Container Exits for more information on how to further troubleshoot such problems.
If system OOM occurs, the exit code of the containers will be 137, indicating they exited due to the
SIGKILL signal. The kernel will display the following error message:
Out of memory: Kill process ...
This can occur when other non-Kubernetes processes deployed on the node use too much memory, or not enough memory was assigned to kubelet using
--system-reserved, leaving too little headroom for other non-container processes.
The total memory usage of all Pods on a node will not exceed the value of
cgroup = capacity - "kube-reserved" - "system-reserved"). In most cases, if memory is properly divided and the non-container processes (such as kubelet, dockerd, kube-proxy and sshd) on the same node do not use up the reserved memory, system OOM should not occur.
Adjust memory allocation according to your needs to avoid this issue.
If the Pod exited due to cgroup OOM, the value of
Reason under Pod events will be
OOMKilled, indicating the actual usage of the container memory exceeded the limit. The kernel log will show the
Memory cgroup out of memory error message.
Adjust limit according to your needs.
If node memory is severely fragmented or lacks large page memory, requests for more memory will fail even though there is plenty of memory left. For instructions on troubleshooting and solutions, refer to Memory Fragmentation.
For information on how to troubleshoot this issue, see Health Check Failures.