<p>I have setup and Kubernetes cluster from kubespray - ansible script. 
Now i have created a deployment with volume to be mounted as hostPath in spec.template.spec.volumes. And i have mounted the volume on all my nodes via nfs file-system. 
Now i read in k8s documentation its not good practice but need to understand the harmfulness for the hostPath. 
Below is sample yaml file.</p>

<pre><code>spec:
  containers:
  - image: test:latest
    imagePullPolicy: Always
    name: test1
    ports:
    - containerPort: 4006
      protocol: TCP
    terminationMessagePath: /dev/termination-log
    terminationMessagePolicy: File
    volumeMounts:
    - name : test-data
      mountPath : /RIC/
    - name : test-config
      mountPath : /xyz/abc.config
      subPath : abc.config
  volumes:
  - name : test-data
    hostPath :
      path : /nfs-mount/RIC/
  - name : test-config
    configMap :
      name : test-config
</code></pre>

Ankit Saxena
<p>if the pod is crashed then kubernetes would spin up new pod. the new pod might get scheduled on different node in the cluster. in that case the data would be lost. To overcome this problem, You might have to add a label to specific node. and get the pod always scheduled to that labled node, that way local hostpath volume gets mounted to the pod.
in the worst case scenario, if the node is crashed then you will lose the data.</p>
