<p>I am new to Kubernetes, so maybe a silly question.<br>
I am trying to deploy statefulset of ElasticSearch with 3 pod replicas. I have defined Statefulset with pvc in spec.<br>
This pvc has storage class which is served by a hostPath volume.  </p>

<pre><code>volumeClaimTemplates:
  - metadata:
      name: beehive-pv-claim
    spec:
      accessModes: [ "ReadWriteOnce" ]
      storageClassName: "local-storage"
      resources:
        requests:
          storage: 1Gi
</code></pre>

<hr>

<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: beehive-pv
spec:
  capacity:
    storage: 10Gi
  volumeMode: Filesystem
  accessModes:
  - ReadWriteOnce
  persistentVolumeReclaimPolicy: Delete
  storageClassName: local-storage
  hostPath:
    path: /home/abc
</code></pre>

<p>I have few doubts.<br>
1) Would above setup/pv serve /host/abc directory on each node separately? i.e. every pod data would be stored on its corresponding node/host path. Also, wouuld k8s show one volume bound to multiple pvc?<br>
2) As I am using statefulset, I am assuming that the once pod-{i} is scheduled on node-{i}, it will always be scheduled there in every case (e.g. restart).<br>
3) Is above setup right way to implement such case where I need to store the data on host local directory. Or local persistent volume is better? I could not get the actual difference between the two.
4) Do I need to create local-storage storage class manually? (Above setup runs fine in docker for windows setup without creating storage class) 
5) I may have other containers also which need to store the data under /home/abc directory only. So, I will be using subPath while mounting the volume in container. Do you see any issue here?</p>

<p>Pleas help.</p>

<p>hostPath volumes work well only on single-node clusters if you have a multi-node environment then you should use Local Persistent Volume</p>

<p>These blog posts explain the Local Persistent Volume.</p>

<p>Official blog - 
<a href="https://kubernetes.io/blog/2019/04/04/kubernetes-1.14-local-persistent-volumes-ga/" rel="nofollow noreferrer">https://kubernetes.io/blog/2019/04/04/kubernetes-1.14-local-persistent-volumes-ga/</a></p>

<p>another reference - <a href="https://vocon-it.com/2018/12/20/kubernetes-local-persistent-volumes/" rel="nofollow noreferrer">https://vocon-it.com/2018/12/20/kubernetes-local-persistent-volumes/</a></p>
