<p>This is what I keep getting:</p>
<pre><code>[root@centos-master ~]# kubectl get pods
NAME               READY     STATUS             RESTARTS   AGE
nfs-server-h6nw8   1/1       Running            0          1h
nfs-web-07rxz      0/1       CrashLoopBackOff   8          16m
nfs-web-fdr9h      0/1       CrashLoopBackOff   8          16m
</code></pre>
<p>Below is output from <code>describe pods</code>
<a href="https://i.stack.imgur.com/qUtPV.png" rel="noreferrer">kubectl describe pods</a></p>
<pre><code>Events:
  FirstSeen LastSeen    Count   From                SubobjectPath       Type        Reason      Message
  --------- --------    -----   ----                -------------       --------    ------      -------
  16m       16m     1   {default-scheduler }                    Normal      Scheduled   Successfully assigned nfs-web-fdr9h to centos-minion-2
  16m       16m     1   {kubelet centos-minion-2}   spec.containers{web}    Normal      Created     Created container with docker id 495fcbb06836
  16m       16m     1   {kubelet centos-minion-2}   spec.containers{web}    Normal      Started     Started container with docker id 495fcbb06836
  16m       16m     1   {kubelet centos-minion-2}   spec.containers{web}    Normal      Started     Started container with docker id d56f34ae4e8f
  16m       16m     1   {kubelet centos-minion-2}   spec.containers{web}    Normal      Created     Created container with docker id d56f34ae4e8f
  16m       16m     2   {kubelet centos-minion-2}               Warning     FailedSync  Error syncing pod, skipping: failed to &quot;StartContainer&quot; for &quot;web&quot; with CrashLoopBackOff: &quot;Back-off 10s restarting failed container=web pod=nfs-web-fdr9h_default(461c937d-d870-11e6-98de-005056040cc2)&quot;
</code></pre>
<p>I have two pods: <code>nfs-web-07rxz</code>, <code>nfs-web-fdr9h</code>, but if I do <code>kubectl logs nfs-web-07rxz</code> or with <code>-p</code> option I don't see any log in both pods.</p>
<pre><code>[root@centos-master ~]# kubectl logs nfs-web-07rxz -p
[root@centos-master ~]# kubectl logs nfs-web-07rxz
</code></pre>
<p>This is my replicationController yaml file:
<a href="https://i.stack.imgur.com/kSbnv.png" rel="noreferrer">replicationController yaml file</a></p>
<pre><code>apiVersion: v1 kind: ReplicationController metadata:   name: nfs-web spec:   replicas: 2   selector:
    role: web-frontend   template:
    metadata:
      labels:
        role: web-frontend
    spec:
      containers:
      - name: web
        image: eso-cmbu-docker.artifactory.eng.vmware.com/demo-container:demo-version3.0
        ports:
          - name: web
            containerPort: 80
        securityContext:
          privileged: true
</code></pre>
<p>My Docker image was made from this simple docker file:</p>
<pre><code>FROM ubuntu
RUN apt-get update
RUN apt-get install -y nginx
RUN apt-get install -y nfs-common
</code></pre>
<p>I am running my kubernetes cluster on CentOs-1611, kube version:</p>
<pre><code>[root@centos-master ~]# kubectl version
Client Version: version.Info{Major:&quot;1&quot;, Minor:&quot;3&quot;, GitVersion:&quot;v1.3.0&quot;, GitCommit:&quot;86dc49aa137175378ac7fba7751c3d3e7f18e5fc&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2016-12-15T16:57:18Z&quot;, GoVersion:&quot;go1.6.3&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
Server Version: version.Info{Major:&quot;1&quot;, Minor:&quot;3&quot;, GitVersion:&quot;v1.3.0&quot;, GitCommit:&quot;86dc49aa137175378ac7fba7751c3d3e7f18e5fc&quot;, GitTreeState:&quot;clean&quot;, BuildDate:&quot;2016-12-15T16:57:18Z&quot;, GoVersion:&quot;go1.6.3&quot;, Compiler:&quot;gc&quot;, Platform:&quot;linux/amd64&quot;}
</code></pre>
<p>If I run the docker image by <code>docker run</code> I was able to run the image without any issue, only through kubernetes I got the crash.</p>
<p>Can someone help me out, how can I debug without seeing any log?</p>

<p>As @Sukumar commented, you need to have your Dockerfile have a <a href="https://docs.docker.com/engine/reference/builder/#/cmd" rel="noreferrer">Command</a> to run or have your ReplicationController specify a command. </p>

<p>The pod is crashing because it starts up then immediately exits, thus Kubernetes restarts and the cycle continues. </p>
