title: kubernetes init container CrashLoopBackOff
body: <p>I am creating a Replication controller with one init-container. however the init container fails to start and the status of the pod is:</p>
  
  <pre><code>NAME                       READY     STATUS             RESTARTS   AGE
  testcontainer   0/1       CrashLoopBackOff   12         37m
  </code></pre>
  
  <p>I am not sure what part is failing exactly, and the logs do not help.
  My kubectl server version is 1.4 (different from client version) so I am using:</p>
  
  <pre><code>annotations:
          pod.beta.kubernetes.io/init-containers:
  </code></pre>
  
  <p>Here is the replication controller yaml file I am using.
  I am using the "hello-world" image (instead of the nginx to make it faster)</p>
  
  <pre><code>apiVersion: v1
  kind: ReplicationController
  metadata:
    name: testcontainer
  spec:
    replicas: 1
    selector:
      app: nginx
    template:
      metadata:
        labels:
          app: nginx
        annotations:
          pod.beta.kubernetes.io/init-containers: '[
              {
                  "name": "install",
                  "image": "hello-world"
              }
          ]'
      spec:
        containers:
        - name: nginx
          image: hello-world
        dnsPolicy: Default
        nodeName: x.x.x.x
  </code></pre>
  
  <p>logs from kubectl describe pod:</p>
  
  <pre><code>Warning FailedSync      Error syncing pod, skipping: failed to "StartContainer" for "nginx" with CrashLoopBackOff: "Back-off 5m0s restarting failed container=nginx pod=testcontainer()"
  
    32m   16s     145     {kubelet x.x.x.x}  spec.containers{nginx}  Warning BackOff Back-off restarting failed docker container
  </code></pre>
  
  <p>when I check the logs of both containers (nginx and testcontainer) it shows the output of running the hello-world image, so I guess the image is downloaded and started successfully. Im not sure what fails after that ( I even tried creating a single pod, using the example provided on <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-initialization/#creating-a-pod-that-has-an-init-container" rel="noreferrer">https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-initialization/#creating-a-pod-that-has-an-init-container</a> , but still fails)</p>