Pod Containers Keeps on Restarting

4/25/2016

Container getting killed at node after pod creation

Issue was raised at github and asked me to move to SO https://github.com/kubernetes/kubernetes/issues/24241

However i am briefing my issue here.After creating pod it doesnt run since i have to mention the container name in the kubelet args under --pod-infra-container-image as mentioned below.

I have solved the issue of Pods Status Container Creating by adding the container name in "--pod-infra-container-image= then pod creation was successful.

However I want to resolve this issue some other way instead of adding containers name in kubelet args. Kindly let me know how do I get this issue fixed.

Also after the pod creation is done. The containers keep on restarting. However if I check the logs via kubectl logs output shows the container expected output.

But the container restarts often. For restarting of pod what i did i have made the restartPolicy: never in spec file of pod and then it didnt restarted however container doesnt run. Kindly help me.

-- Arjun M
kubernetes

1 Answer

4/29/2016

Your description is very confusing, can you please reply to this answer with:
1. What error you get when you do docker pull gcr.io/google_containers/pause:2.0
2. What cmd you're running in your container

For 2 you need a long running command, like while true; do echo SUCCESS; done, otherwise it'll just exit and get restarted by the kubelet with a RestartPolicy of Always.

-- Prashanth B
Source: StackOverflow