kubernetes coreos rbd storageclass

10/25/2016

I want use k8s storageclass under coreos, but failed

.CoreOS version is stable (1122.2) .Hyperkube version is v1.4.3_coreos.0

k8s cluster deployed by coreos-kubernetes script , and modify rkt_opts for rbd recommandded by kubelet-wrapper.md

ceph version is jewel, I have mounted a rbd image on coreos , it works well.

now, I try to use pvc in pods, Refer to the kubernetes official document https://github.com/kubernetes/kubernetes/tree/master/examples/experimental/persistent-volume-provisioning

the config files:

  **ceph-secret-admin.yaml** 
    apiVersion: v1
    kind: Secret
    metadata:
      name: ceph-secret-admin
      namespace: kube-system
    data:
      key: QVFDTEl2NVg5c0U2R1JBQVRYVVVRdUZncDRCV294WUJtME1hcFE9PQ==

 **ceph-secret-user.yaml** 
    apiVersion: v1
    kind: Secret
    metadata:
      name: ceph-secret-user
    data:
      key: QVFDTEl2NVg5c0U2R1JBQVRYVVVRdUZncDRCV294WUJtME1hcFE9PQ==
 **rbd-storage-class.yaml**
    apiVersion: storage.k8s.io/v1beta1
    kind: StorageClass
    metadata:
      name: kubepool
      annotations:
        storageclass.beta.kubernetes.io/is-default-class: 'true'
    provisioner: kubernetes.io/rbd
    parameters:
        monitors: 10.199.134.2:6789,10.199.134.3:6789,10.199.134.4:6789
        adminId: rbd
        adminSecretName: ceph-secret-admin
        adminSecretNamespace: kube-system
        pool: rbd
        userId: rbd
        userSecretName: ceph-secret-user
   **claim1.json :**
     {
      "kind": "PersistentVolumeClaim",
      "apiVersion": "v1",
      "metadata": {
        "name": "claim1",
        "annotations": {
            "volume.beta.kubernetes.io/storage-class": "kubepool"
        }
      },
      "spec": {
        "accessModes": [
          "ReadWriteOnce"
        ],
        "resources": {
          "requests": {
            "storage": "3Gi"
          }
        }
      }
    }

the secret create ok, the storageclass create seems ok, but can't describe (no description has been implemented for "StorageClass"), when create pvc, it's status always pending , describe it:

Name:           claim1
Namespace:      default
Status:         Pending
Volume:
Labels:         <none>
Capacity:
Access Modes:
Events:
  FirstSeen     LastSeen        Count   From                            SubobjectPath   Type            Reason                  Message
  ---------     --------        -----   ----                            -------------   --------        ------                  -------
  16m           14s             66      {persistentvolume-controller }                  Warning         ProvisioningFailed      no volume plugin matched

Could some one help me ?

-- XJ.chen
ceph
coreos
kubernetes
persistent-volumes

0 Answers