Dynamic Persistent Volumes with Kuberenetes Heketi not working

6/7/2017

I deployed heketi/gluster on Kubernetes 1.6 cluster. Then I followed the guide to create a StorageClass for dynamic persistent volumes, but no pv are created if I create pvc.

heketi and glusterfs pods running and working as expected if I use heketi-cli manually and create pv manually. The pv are also claimed by pvc.

I feels like that I'm missing a step, but I don't know which one. I followed the guides and I assumed that dynamic persistent volumes should "just work".

  1. install heketi-cli and glusterfs-client
  2. use ./gk-deploy -g
  3. create StorageClass
  4. create PVC Did I missed a step?

StorageClass

$ kubectl get storageclasses
NAME      TYPE
slow      kubernetes.io/glusterfs   

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  creationTimestamp: 2017-06-07T06:54:35Z
  name: slow
  resourceVersion: "82741"
  selfLink: /apis/storage.k8s.io/v1/storageclassesslow
  uid: 2aab0a5c-4b4e-11e7-9ee4-001a4a3f1eb3
parameters:
  restauthenabled: "false"
  resturl: http://10.2.35.3:8080/
  restuser: ""
  restuserkey: ""
provisioner: kubernetes.io/glusterfs

PVC

$ kubectl -nkube-system get pvc
NAME                          STATUS    VOLUME               CAPACITY   ACCESSMODES   STORAGECLASS   AGE
gluster1                      Bound     glusterfs-b427d1f1   1Gi        RWO                          15m
influxdb-persistent-storage   Pending                                                 slow           14h

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","kind":"PersistentVolumeClaim","metadata":{"annotations":{"volume.beta.kubernetes.io/storage-class":"slow"},"labels":{"k8s-app":"influxGrafana"},"name":"influxdb-persistent-storage","namespace":"kube-system"},"spec":{"accessModes":["ReadWriteOnce"],"resources":{"requests":{"storage":"1Gi"}}}}
    volume.beta.kubernetes.io/storage-class: slow
    volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/glusterfs
  creationTimestamp: 2017-06-06T16:48:46Z
  labels:
    k8s-app: influxGrafana
  name: influxdb-persistent-storage
  namespace: kube-system
  resourceVersion: "87638"
  selfLink: /api/v1/namespaces/kube-system/persistentvolumeclaims/influxdb-persistent-storage
  uid: 021b69c4-4ad8-11e7-9ee4-001a4a3f1eb3
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 1Gi
status:
  phase: Pending

Sources:

https://github.com/gluster/gluster-kubernetes

http://blog.lwolf.org/post/how-i-deployed-glusterfs-cluster-to-kubernetes/

Environment:

$ kubectl cluster-info
Kubernetes master is running at https://andrea-master-0.muellerpublic.de:443
KubeDNS is running at https://andrea-master-0.muellerpublic.de:443/api/v1/proxy/namespaces/kube-system/services/kube-dns
kubernetes-dashboard is running at https://andrea-master-0.muellerpublic.de:443/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard

$ heketi-cli cluster list
Clusters:
24dca142f655fb698e523970b33238a9

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"clean", BuildDate:"2017-05-19T18:44:27Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4+coreos.0", GitCommit:"8996efde382d88f0baef1f015ae801488fcad8c4", GitTreeState:"clean", BuildDate:"2017-05-19T21:11:20Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
-- Erwin
glusterfs
kubernetes

1 Answer

6/7/2017

The problem was the slash in the StorageClass resturl.

resturl: http://10.2.35.3:8080/ must be resturl: http://10.2.35.3:8080

PS: o.O ....

-- Erwin
Source: StackOverflow