<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>Every time you add a new deployment you would first need to add an NFS volume and mount it on every node. </p>

<p>If you could add your NFS storage system as a storage provider Kubernetes would take over most of the tasks. Kubernetes would create a volume in your storage system if you add a KubernetesPersistence volume object and mount the volume to the node where the pod is scheduled. </p>
