Pod Status: CrashLoopBackOff or Init:CrashLoopBackOff
This indicates a problem with one of the containers. Check .status.containerStatuses or .status.initContainerStatuses, respectively, using the command below. Check all containers for a lastState field — this should indicate the failure reason.
kubectl get pod ${POD_NAME} -n ${NAMESPACE} -o yaml | yq '.status.containerStatuses'
kubectl get pod ${POD_NAME} -n ${NAMESPACE} -o yaml | yq '.status.initContainerStatuses'
Reason: Error
Your application is crashing. Check the pod logs.
kubectl logs ${POD_NAME} -n ${NAMESPACE} -c ${CONTAINER_NAME}
Reason: OOMKilled
If the reason is OOMKilled, you need to increase the memory requests and limits for the application — this will let the scheduler and autoscaler know how much memory your application needs. If your application continues getting OOMKilled even after increasing the memory to a reasonable amount, make sure your application does not have a memory leak.