<p>I have set up a a two node cluster on Raspberry pi. I was wondering if it would be possible to make a hard drive connected to the master node as the persistent volume ? I am unable to find any options in the documentation.</p>

<p>Any suggestions or directions is much appreciated.thanks</p>

IT_novice
<p><strong>hostPath volume Type</strong></p>

<p>The <a href="https://kubernetes.io/docs/concepts/storage/volumes/#hostpath" rel="nofollow noreferrer">hostPath</a> volume type is single-node only, meaning that a pod on one node cannot access the hostPath volume on another node. One way to get around this limitation may be to either create a <a href="https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/" rel="nofollow noreferrer">StatefulSet</a> or Daemonset which could force pods to always deploy to the same node(s), or force a deployment's pods to always be deployed to the same node via a <a href="https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#nodeselector" rel="nofollow noreferrer">nodeSelector</a>.</p>

<p><strong>If you are circumventing the hostPath single-node limitation via nodeSelector while using multiple pods on the same node beware of the following issue:</strong></p>

<p><a href="https://stackoverflow.com/questions/46738296/multiple-kubernetes-pods-sharing-the-same-host-path-pvc-will-duplicate-output">Multiple Kubernetes pods sharing the same host-path/pvc will duplicate output</a></p>

<p><strong>Alternative Volume Types</strong></p>

<p>If you do not wish to circumvent the limitation of the hostPath volume type, you should look into other volume types such as NFS or Gluster, both of which you can setup locally, but require some additional configuration and setup.</p>

<p>If you have only one drive which you can attach to one node, I think you should use the basic NFS volume type as it does not require replication.</p>

<p>If however, you can afford another drive to plug in to the second node, you can take advantage of GlusterFS's replication feature.</p>

<p><strong>Volume Types</strong></p>

<p>NFS: <a href="https://kubernetes.io/docs/concepts/storage/volumes/#nfs" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/storage/volumes/#nfs</a></p>

<p>GlusterFS: <a href="https://kubernetes.io/docs/concepts/storage/volumes/#glusterfs" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/storage/volumes/#glusterfs</a></p>

<p><strong>Converting a drive to a volume:</strong></p>

<p>As for making your hard-drive become a persistent volume, I would separate that into 2 tasks.</p>

<ol>
<li><p>You need mount your physical drive to make it available at a specific path within your operating system.</p></li>
<li><p>Refer to the path of the mounted drive when configuring NFS, GlusterFS, or hostPath.</p></li>
</ol>
