Why the image that built by myself dont run on the kubernetes,and the pod always restart?

11/26/2015

I create a image centos_etcd_socat from the base image centos. I want to create a pod. the content follows:

apiVersion: V1
kind: Pod 
metadata: 
  name: testetcd 
  labels: 
    app: testetcd 
spec: 
  containers: 
  - name: testetcd 
    image: centos_etcd_socat 
    nodeselector: 
      noderole: nodeslave1 

When I create the pod it is always in the restarting state:

NAME              READY    STATUS   RESTARTS  AGE   NODE
nginx             1/1      Running   1        35d   127.0.0.1
nodeselectiontest 1/1      Running   0        3h    127.0.0.1
testetcd          0/1      Running   12       41m   192.168.10.10
testubuntu        1/1      Running   1        1d    192.168.10.10

Why the pod is always restart?

-- 闵云飞
docker
kubernetes

1 Answer

12/16/2015

what is the content of your image?

If the container is an ephemeral service (i.e. a one time command) or it does not have any specific long running command as entrypoint, it will terminate right away.

Then the Replication Controller will try to restart it. So, first things first, try your container with Docker to see if it runs. If it runs as intended, run it on Kubernetes with the Replication Controller.

You can also check the logs with kubectl logs <container-id>

which should tell you what is going on in your pod (if you log anything of course)

-- MrE
Source: StackOverflow