使用Kuberenetes Heketi的动态持久卷不起作用

时间:2017-06-07 07:54:08

标签: kubernetes glusterfs

我在Kubernetes 1.6集群上部署了heketi / gluster。然后我按照指南为动态持久卷创建了一个StorageClass,但是如果我创建了pvc则没有创建pv。

如果我手动使用heketi-cli并手动创建pv,那么heketi和glusterfs pod正在按预期运行和工作。 pv也声称pv。

我觉得我错过了一步,但我不知道哪一步。我遵循指南,我认为动态持久卷应该“正常工作”。

  1. 安装heketi-cli和glusterfs-client
  2. 使用./gk-deploy -g
  3. 创建StorageClass
  4. 创建PVC 我错过了一步吗?
  5. 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
    

    来源:

    DOM classes

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

    环境:

    $ 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"}
    

1 个答案:

答案 0 :(得分:0)

问题是StorageClass resturl中的斜杠。

resturl: http://10.2.35.3:8080/必须为resturl: http://10.2.35.3:8080

PS:o.O ....