Debian – Docker/Kubernetes (Minikube) boot time – mount: unknown filesystem type ‘glusterfs’

debiandockerglusterfskubernetes

I'm trying to set up a kubernetes/docker container (using Minikube) with a glusterfs volume mounted, but every time I try to start the service/pods I get "mount: unknown filesystem type 'glusterfs'" in the error logs.

However when I start the container without the volumes setup in the kubernetes configuration, add an entry for the server to /etc/hosts, create a mount point and then mount it manually it works fine. Additionally the persistent volume is shown as claimed despite erroring out.

Statefulset

---
apiVersion: v1
kind: Service
metadata:
  name: backend-development
  labels:
    app: backend-development
spec:
  ports:
  - port: 80
    name: web
  clusterIP: None
  selector:
    app: backend-development

---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
  name: backend-development
spec:
  serviceName: "backend-development"
  replicas: 3
  template:
    metadata:
      labels:
        app: backend-development
    spec:
      terminationGracePeriodSeconds: 10
      containers:
        - name: backend-development
          image: mount-test-gluster
          imagePullPolicy: Never
          ports:
            - containerPort: 80
              name: web
          securityContext:
            privileged: true
          volumeMounts:
            - name: certificates-storage
              mountPath: /etc/secrets
  volumeClaimTemplates:
  - metadata:
      name: certificates-storage
      annotations:
        volume.beta.kubernetes.io/storage-class: gluster-standard
    spec:
      accessModes: [ "ReadWriteMany" ]
      resources:
        requests:
          storage: 20Mi

Gluster end point:

apiVersion: v1
kind: Endpoints
metadata:
  name: gluster-cluster 
subsets:
- addresses:              
  - ip: 10.108.162.33
  ports:                  
  - port: 1 # port number is ignored, but must be legal
    protocol: TCP

---
apiVersion: v1
kind: Service
metadata:
  name: gluster-cluster
spec:
  ports:
  - port: 1 # port number is ignored but must be legal

Gluster storage class:

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
    name: gluster-standard
provisioner: kubernetes.io/glusterfs
parameters:
    endpoint: "gluster-cluster"
    resturl: "http://10.108.162.33:8081"

PersistentVolume configuration:

apiVersion: v1
kind: PersistentVolume
metadata:
    name: certificates-storage
spec:
    capacity:
        storage: 20Mi
    accessModes:
        - ReadWriteMany
    glusterfs:
        endpoints: gluster-cluster
        path: /certificates-volume
        readOnly: false
    persistentVolumeReclaimPolicy: Retain
    storageClassName: gluster-standard

Dockerfile for mount-test-gluster:

FROM debian:stretch
MAINTAINER me@example.org

RUN apt update && apt upgrade -y && apt install -y nginx wget gnupg2 apt-transport-https

COPY glusterfs-client-install.sh /opt/
RUN /opt/glusterfs-client-install.sh

CMD ["nginx", "-g", "daemon off;"]

glusterfs-client-install.sh

#!/bin/bash
GLUSTER_VERSION='3.10'
wget -O - http://download.gluster.org/pub/gluster/glusterfs/${GLUSTER_VERSION}/rsa.pub | apt-key add -
echo deb http://download.gluster.org/pub/gluster/glusterfs/3.10/LATEST/Debian/stretch/apt stretch main > /etc/apt/sources.list.d/gluster.list 
apt update && apt install -y glusterfs-client

Best Answer

As of late 2016, this is a known issue. It appears that a fix was attempted but it has not been released, which means it is buggy. You may have to continue to manually mount it for a while.

You can follow this bug here: https://github.com/rancher/rancher/issues/4348

Related Topic