Pods is getting crashed in Kubernetes cluster

11/27/2017

My Pod is getting crashed and restarting multiple time while deploying my java application using kubernetes cluster.

I am able to run small micro services using kubernetes pod.

While creating pod I am getting the below exception:

Warning BackOff         Back-off restarting failed docker container
    24s   10s     2       {kubelet 192.168.1.31}
Warning FailedSync      Error syncing pod, skipping: failed to "StartContainer" for
    "enliven" with CrashLoopBackOff: "Back-off 1m20s restarting failed
    container=enliven pod=enliven_default(75d49b7a-d36f-11e7-9800-0021f6220722)"

Any suggestion?

-- sanjay
kubernetes
kubernetes-pod

1 Answer

11/27/2017

You could start by checking the logs on the pod, to see if the application is failing to start for whatever reason. You can do that using

kubectl logs your_pod_name --previous

One potential problem that I'd take look at, is if your Java application is taking more resources than are available/allowed on the cluster. Here you can see how requests and limits work. But your pod may had been killed by Kubernetes due to this very reason: too much resources usage.

-- Jose Armesto
Source: StackOverflow