title: HostPath with minikube - Kubernetes
body: <p>UPDATE:
  I connected to the minikubevm and I see my host directory mounted but there is no files there. Also when I create a file there it will not in my host machine. Any link are between them</p>
  
  <p>I try to mount an host directory for developing my app with kubernetes.</p>
  
  <p>As the doc recommended, I am using minikube for running my kubernetes cluster on my pc. The goal is to create a develop environment with docker and kubernetes for develop my app. I want to mount a local directory so my docker will read the code app from there. But it is not work. Any help would be really appreciate.</p>
  
  <p>my test app (server.js):</p>
  
  <pre><code>var http = require('http');
  var handleRequest = function(request, response) {
  response.writeHead(200);
  response.end("Hello World!");
  }
  var www = http.createServer(handleRequest);
  www.listen(8080);
  </code></pre>
  
  <p>my Dockerfile:</p>
  
  <pre><code>FROM node:latest
  WORKDIR /code
  ADD code/ /code
  EXPOSE 8080
  CMD server.js
  </code></pre>
  
  <p>my pod kubernetes configuration: (pod-configuration.yaml)</p>
  
  <pre><code>apiVersion: v1
  kind: Pod
  metadata:
    name: apiserver
  spec:
    containers:
    - name: node
      image: myusername/nodetest:v1
      ports:
      - containerPort: 8080
      volumeMounts:
      - name: api-server-code-files
        mountPath: /code
    volumes:
    - name: api-server-code-files
      hostPath:
        path: /home/&lt;myuser&gt;/Projects/nodetest/api-server/code
  </code></pre>
  
  <p>my folder are:</p>
  
  <pre><code>/home/&lt;myuser&gt;/Projects/nodetest/
  - pod-configuration.yaml
  - api-server/
      - Dockerfile
      - code/
          - server.js
  </code></pre>
  
  <p>When I running my docker image without the hostPath volume it is of course works but the problem is that on each change I will must recreate my image that is really not powerful for development, that's why I need the volume hostPath.</p>
  
  <p>Any idea ? why i don't success to mount my local directory ?</p>
  
  <p>Thanks for the help.</p>