<p>i've a kubernetes cluster with a master node and 3 minions, i've already a glusterfs cluster, every node of kubernetes cluster have glusterfs-client installed and working.
i'm trying to run a pod ( a simple mysql ) mounting /var/lib/mysql on glusterfs but i see:</p>

<pre><code>Image: mysql:5.6 is ready, container is creating 
</code></pre>

<p>i run: 
    kubectl get event 
i see:</p>

<pre><code>Thu, 18 Feb 2016 10:08:01 +0100   Thu, 18 Feb 2016 10:08:01 +0100   1         mysql-9ym10         Pod                                 scheduled          {scheduler }                Successfully assigned mysql-9ym10 to nodeXX
Thu, 18 Feb 2016 10:08:01 +0100   Thu, 18 Feb 2016 10:08:01 +0100   1         mysql               ReplicationController               successfulCreate   {replication-controller }   Created pod: mysql-9ym10
Thu, 18 Feb 2016 10:08:02 +0100   Thu, 18 Feb 2016 10:08:12 +0100   2         mysql-9ym10         Pod                                 failedMount        {kubelet nodeXX}    Unable to mount volumes for pod "mysql-9ym10_default": exit status 1
Thu, 18 Feb 2016 10:08:02 +0100   Thu, 18 Feb 2016 10:08:12 +0100   2         mysql-9ym10         Pod                                 failedSync         {kubelet nodeXX}    Error syncing pod, skipping: exit status 1
</code></pre>

<p>if i run 
    kubectl describe pod mysql-9ym10 
i see:</p>

<pre><code>Name:                           mysql-9ym10
Namespace:                      default
Image(s):                       mysql:5.6
Node:                           nodeXX/nodeXX
Labels:                         app=mysql
Status:                         Pending
Reason:
Message:
IP:
Replication Controllers:        mysql (1/1 replicas created)
Containers:
  mysql:
    Image:              mysql:5.6
    State:              Waiting
      Reason:           Image: mysql:5.6 is ready, container is creating
    Ready:              False
    Restart Count:      0
Conditions:
  Type          Status
  Ready         False 
Events:
  FirstSeen                             LastSeen                        Count   From                            SubobjectPath   Reason          Message
  Thu, 18 Feb 2016 10:08:01 +0100       Thu, 18 Feb 2016 10:08:01 +0100 1       {scheduler }                                    scheduled       Successfully assigned mysql-9ym10 to nodeXX
  Thu, 18 Feb 2016 10:08:02 +0100       Thu, 18 Feb 2016 10:10:22 +0100 15      {kubelet nodeXX}                        failedMount     Unable to mount volumes for pod "mysql-9ym10_default": exit status 1
  Thu, 18 Feb 2016 10:08:02 +0100       Thu, 18 Feb 2016 10:10:22 +0100 15      {kubelet nodeXX}                        failedSync      Error syncing pod, skipping: exit status 1
</code></pre>

<p>this is the yaml file for container:</p>

<pre><code>apiVersion: v1
kind: ReplicationController
metadata:
  name: mysql
spec:
  replicas: 1
  selector:
    app: mysql
  template:
    metadata:
      name: mysql
      labels:
        app: mysql
    spec:
      containers:
      - name: mysql
        image: mysql:5.6
        ports:
        - containerPort: 3306
        env:
          - name: MYSQL_ROOT_PASSWORD
            value: password
        volumeMounts:
          - mountPath: /var/lib/mysql
            name: glusterfsvol
      volumes:
      - glusterfs:
          endpoints: glusterfs-cluster
          path: glustervolume
          readOnly: false
        name: glusterfsvol
</code></pre>

<p>On first: To use a GlusterFS you don't need to install glusterfs-client on kubernetes node. Kubernetes have the volume mounting option for glusterfs by default.</p>

<p>To use a glusterfs with kubernetes you need to things.</p>

<ol>
<li><p>a working glusterfs server. a running volume in the glusterfs server. I assume you have those. If anyone don't then create a glusterfs server and start your volumes with the following commands</p>

<pre><code>$ gluster volume create &lt;volume-name&gt; replica 2 transport tcp \
  peer1:/directory \
  peer2:/directory \
  force
$ gluster volume start &lt;vonlume-name&gt;
$ sudo gluster volume info
</code></pre></li>
<li><p>if this is ok, you need an kubernetes endpoint to use with the pod. as far an example a end point is like this.</p>

<pre><code>kind: Endpoints
apiVersion: v1
metadata:
  name: glusterfs
subsets:
- addresses:
  - ip: peer1
  ports:
  - port: 1
- addresses:
  - ip: peer2
  ports:
  - port: 1
</code></pre></li>
<li><p>And at third mount the gfs volume to a pod with the end point.</p>

<pre><code>      containers:
      - name: mysql
        image: mysql:5.6
        ports:
        - containerPort: 3306
        env:
          - name: MYSQL_ROOT_PASSWORD
            value: password
        volumeMounts:
          - mountPath: /var/lib/mysql
            name: glusterfsvol
      volumes:
      - glusterfs:
           endpoints: glusterfs-cluster
           path: &lt;volume-name&gt;
         name: glusterfsvol
</code></pre></li>
</ol>

<p>**The path must match the volume name with the glusterfs.</p>

<p>this all should work fine.</p>
