<p>I am currently testing a Kubernetes+GlusterFS+Elastic setup with VirtualBox Ubuntu VMs. I have two, one master and one node. The guide for GlusterFS <a href="https://github.com/gluster/gluster-kubernetes/blob/master/docs/setup-guide.md" rel="nofollow noreferrer">here</a> says:</p>

<p><em>"There must be at least three nodes"</em></p>

<p>I am not sure what does that mean. To elaborate a bit on what I don't understand:</p>

<ul>
<li>Are we talking about three Kubernetes pods running GlusterFS within the greater
Kubernetes cluster, or three GlusterFS nodes within the GlusterFS
cluster that exists within the Kubernetes cluster as a single pod?</li>
<li>Can this requirement be met by my current setup? I was thinking of attaching 1 raw disk to the node VM with size, let's say 90GB. Then I would split that raw space to three /dev/sda2, /dev/sda3, /dev/sda4, each one 30GB, without formatting them. Now this Virtualbox VM node is also a Kubernetes node. I am assuming that Kubernetes will auto-mount those three raw spaces in the virtual world. Then, if we are talking about three Kubernetes pods, each one will have it's own virtual pod IP. As a result, I would be able to declare IP-/dev/sda# pairs in the <a href="https://github.com/gluster/gluster-kubernetes/blob/master/deploy/topology.json.sample" rel="nofollow noreferrer">topology file mentioned in the guide</a> in the storage and device field respectively. In my case I will have only one device per storage IP. Does my logic make sense?</li>
</ul>

Tasos
<blockquote>
  <p>Are we talking about three Kubernetes pods running GlusterFS within the greater Kubernetes cluster, or three GlusterFS nodes within the GlusterFS cluster that exists within the Kubernetes cluster as a single pod?</p>
</blockquote>

<p>Those requirements are related to the cluster quorum of GlusterFS. Those requirements implies different nodes for the High Availability GlusterFS. In the case you have a real Kubernetes cluster with different nodes you would deploy GlusterFS in each of the nodes so the data is safely replicated across all the nodes, and you would be safe in the case you loose one node.</p>

<p><a href="https://staged-gluster-docs.readthedocs.io/en/release3.7.0beta1/Features/server-quorum/" rel="nofollow noreferrer">Here you have the GlusterFS reference</a>, hope its useful.</p>

<blockquote>
  <p>Can this requirement be met by my current setup? I was thinking of attaching 1 raw disk to the node VM with size, let's say 90GB. Then I would split that raw space to three /dev/sda2, /dev/sda3, /dev/sda4, each one 30GB, without formatting them. Now this Virtualbox VM node is also a Kubernetes node. I am assuming that Kubernetes will auto-mount those three raw spaces in the virtual world. Then, if we are talking about three Kubernetes pods, each one will have it's own virtual pod IP. As a result, I would be able to declare IP-/dev/sda# pairs in the topology file mentioned in the guide in the storage and device field respectively. In my case I will have only one device per storage IP. Does my logic make sense?</p>
</blockquote>

<p>I think you won't be able to do this. If you look closer at the deployment manifests of GlusterFS:</p>

<pre><code>---
kind: DaemonSet
apiVersion: extensions/v1beta1
metadata:
  name: glusterfs
  labels:
    glusterfs: daemonset
  annotations:
    description: GlusterFS DaemonSet
    tags: glusterfs
spec:
</code></pre>

<p><a href="https://github.com/gluster/gluster-kubernetes/blob/master/deploy/kube-templates/glusterfs-daemonset.yaml" rel="nofollow noreferrer">Ref</a>.</p>

<p>You can see that the deployment method of GlusterFS it is a <em>Daemonset</em>, which means that you will have one pod per node.
In any case, looking at the <em>Best practices</em> section of the GlusterFS reference I shared above it says you can deploy a cluster of GlusterFS with two nodes. You won't have that third node for disaster recovery, but you will be able to test it.</p>

<p>Hope this clarifies things to you :)</p>
