<p>I am new to kubernetes. Recently set up kubernetes cluster with 1 master and 1 node. </p>

<p>I am able to start a docker container by running 
<code>sudo docker run &lt;docker-image&gt;</code> in my node machine. </p>

<p>But i failed to start docker container as a pod using kubernetes yml file. 
by running <code>sudo kubectl create -f deployment.yml</code></p>

<p>I describe the pod information and saw this error message. </p>

<pre><code>      Last State:   Terminated
      Reason:       ContainerCannotRun
      Message:      OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"HOSTNAME\": executable file not found in $PATH": unknown
      Exit Code:    128
</code></pre>

<p>docker container supposes to start a java executable. 
this is my deployment file </p>

<pre><code>kind: Service
apiVersion: v1
metadata:
  name: service1-service
spec:
  selector:
    app: service1
  ports:
    - protocol: "TCP"
      # Port accessible inside cluster
      port: 26666
      # Port to forward to inside the pod
      targetPort: 26666
      # Port accessible outside cluster
      nodePort: 26666
  type: LoadBalancer

---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: service1-depolyment
spec:
  selector:
    matchLabels:
      app: service1
  replicas: 1
  template:
    metadata:
      labels:
        app: service1
    spec:
      containers:
        - name: service1
          image: service1-docker-image
          imagePullPolicy: Never
          ports:
            - containerPort: 26666
          # args: ["HOSTNAME", "KUBERNETES_PORT"]
</code></pre>

<p>In this deployment file, I try to create a nginx and one java web applicaition service. </p>

<p>It is because i defined wrong apiVersion and kind ?  </p>

<p>Any help would be appreciated.</p>

John
<p>Look at this error <code>exec: \"HOSTNAME\": executable file not found in $PATH</code></p>

<p>I had a similar error since the container could not locate the docker "CMD" binary since I gave it the wrong path. Check the path to the file and that should do the trick.</p>
