title: MountVolume.SetUp failed for volume "mongo" : hostPath type check failed: /mongo/data is not a directory
body: <p>I'm trying to configure a hostPath to launch Mongodb pod.</p>
  
  <p>I have only one node of kubernetes v1.8.5 installed with rancher last stable version.</p>
  
  <p>I have create folder <code>/mongo/data</code> and allow all permissions to all users.
  <a href="https://i.stack.imgur.com/US7WD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/US7WD.png" alt="enter image description here"></a></p>
  
  <p>I'm able to run docker image perfectly with docker without sudo:</p>
  
  <p><code>docker run --name some-mongo -v /mongo/data:/data/db mongo:3.2.1</code></p>
  
  <p>But when I launch to kubernetes:</p>
  
  <p><code>sudo kubectl create -f mongodb.yml</code></p>
  
  <p>I get <code>MountVolume.SetUp failed for volume "mongo" : hostPath type check failed: /mongo/data is not a directory</code></p>
  
  <p>This is the mongodb.yml:</p>
  
  <pre><code>apiVersion: v1
  kind: Pod
  metadata:
    name: test-pd
  spec:
    containers:
    - image: mongo:3.2.1
      name: test-container
      volumeMounts:
      - mountPath: /data/db
        name: mongo
    volumes:
    - name: mongo
      hostPath:
        # directory location on host
        path: /mongo/data
        # this field is optional
        type: Directory
  </code></pre>
  
  <p>Any idea where I should looking for?</p>