Kubernetes Ceph RBD Integration / Ubuntu 18.04 Environment
1. Configuration Environment
The configuration environment is as follows.
- Kubernetes 1.12
- Ceph
- Monitor IP : 10.0.0.10:6789
- Pool Name : kube
2. Ceph RDB Integration
$ ceph auth get client.admin 2>&1 |grep "key = " |awk '{print $3'} |xargs echo -n > /tmp/secret
$ kubectl create secret generic ceph-admin-secret --from-file=/tmp/secret --namespace=kube-systemCreate a Ceph Admin secret.
$ ceph osd pool create kube 8 8
$ ceph auth add client.kube mon 'allow r' osd 'allow rwx pool=kube'
$ ceph auth get-key client.kube > /tmp/secret
$ kubectl create secret generic ceph-secret --from-file=/tmp/secret --namespace=kube-systemCreate a Ceph Pool and User secret.
$ git clone https://github.com/kubernetes-incubator/external-storage.git
$ cd external-storage/ceph/rbd/deployDownload rbd-provisioner, role, and cluster role yaml files.
| |
Add the contents of [File 1] to the rbac/clusterrole.yaml file. (Secret Role)
$ NAMESPACE=default
$ sed -r -i "s/namespace: [^ ]+/namespace: $NAMESPACE/g" ./rbac/clusterrolebinding.yaml ./rbac/rolebinding.yaml
$ kubectl -n $NAMESPACE apply -f ./rbac Configure rbd-provisioner, role, and cluster role.
| |
Create the storage-class.yaml file and save it with the contents of [File 2].
$ kubectl create -f ./storage-class.yaml
$ kubectl get storageclasses.storage.k8s.io
NAME PROVISIONER AGE
rbd (default) ceph.com/rbd 19mCreate and verify the Storage Class.