title: hostPath as volume in kubernetes
body: <p>I am trying to configure hostPath as the volume in kubernetes. I have logged into VM server, from where I usually use kubernetes commands such as kubectl.</p>
  
  <p>Below is the pod yaml:</p>
  
  <pre><code>apiVersion: apps/v1beta1
  kind: Deployment
  metadata:
    name: helloworldanilhostpath
  spec:
    replicas: 1
    template:
      metadata:
        labels:
          run: helloworldanilhostpath
      spec:
        volumes:
          - name: task-pv-storage
            hostPath:
              path: /home/openapianil/samplePV
              type: Directory
        containers:
        - name: helloworldv1
          image: ***/helloworldv1:v1
          ports:
          - containerPort: 9123
          volumeMounts:
           - name: task-pv-storage
             mountPath: /mnt/sample
  </code></pre>
  
  <p>In VM server, I have created "/home/openapianil/samplePV" folder and I have a file present in it. It has a sample.txt file.</p>
  
  <p>once I try to create this deployment. it does not happen with error -<br>
    Warning  FailedMount            28s (x7 over 59s)  kubelet, aks-nodepool1-39499429-1  MountVolume.SetUp failed for volume "task-pv-storage" : hostPath type check failed: /home/openapianil/samplePV is not a directory.</p>
  
  <p>Can anyone please help me in understanding the problem here.</p>