title: How does PersistentVolume work with hostPath?
body: <p>I have deployed Gitlab to my azure kubernetes cluster with a persistant storage defined the following way:</p>
  
  <pre><code>kind: PersistentVolume
  apiVersion: v1
  metadata:
    name: gitlab-data
    namespace: gitlab
  spec:
    capacity:
      storage: 8Gi
    accessModes:
      - ReadWriteMany
    hostPath:
      path: "/tmp/gitlab-data"
  </code></pre>
  
  <p>That worked fine for some days. Suddenly all my data stored in Gitlab is gone and I don't know why. I was assuming that the <code>hostPath</code> defined PersistentVolumen is really persistent, because it is saved on a node and somehow replicated to all existing nodes. But my data now is lost and I cannot figure out why. I looked up the uptime of each node and there was no restart. I logged in into the nodes and checked the path and as far as I can see the data is gone.</p>
  
  <p>So how do PersistentVolume Mounts work in Kubernetes? Are the data saved really persistent on the nodes? How do multiple nodes share the data, if a deployment is split to multiple nodes? Is <code>hostPath</code> reliable persistent storage?</p>