What is the reason for Back-off restarting failed container for elasticsearch kubernetes pod?
I had the same problem, there can be couple of reasons for this issue. In my case the jar file was missing. @Lakshya has already answered this problem, I would like to add the steps that you can take to troubleshoot it.
- Get the pod status, Command - kubectl get pods
- Describe pod to have further look - kubectl describe pod "pod-name"The last few lines of output gives you events and where your deployment failed
- Get logs for more details - kubectl logs "pod-name"
- Get container logs - kubectl logs "pod-name" -c "container-name"Get the container name from the output of describe pod command
If your container is up, you can use the kubectl exec -it command to further analyse the container
Hope it helps community members in future issues.
I found the logs using docker logs
for the es container and found that es was not starting because of the vm.max_map_count
set to very low value.I changed the vm.max_map_count
to desired value using sysctl -w vm.max_map_count=262144
and the pod has started after that.
This thread is old but will help others. Below is the list of Kubernetes Error Exit codes with reasons.
https://kashifraza.guru/2021/08/23/use-exit-code-to-identify-pod-exceptions/
#define EX_CONFIG 78 configuration error#define EX__MAX 78 78 maximum listed value