CrashLoopBackOff Error #
This error indicates a pod cannot be scheduled on a node. This could happen because the node does not have sufficient resources to run the pod, or because the pod did not succeed in mounting the requested volumes.
Check pos status #
kubectl get pods --namespace myns
Check detailed information of the pod #
kubectl describe pod myns-pod-1 --namespace myns
Identify the issue #
- Insufficient resourcesif there are insufficient resources on the node, you can manually evict pods from the node or scale up your cluster to ensure more nodes are available for your pods.
- Volume mountingif you see the issue is mounting a storage volume, check which volume the pod is trying to mount, ensure it is defined correctly in the pod manifest, and see that a storage volume with those definitions is available.
- Use of hostPortif you are binding pods to a hostPort, you may only be able to schedule one pod per node. In most cases you can avoid using hostPort and use a Service object to enable communication with your pod.
Reference #
https://komodor.com/learn/how-to-fix-crashloopbackoff-kubernetes-error/