You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

79 lines
2.3 KiB

  1. # RBD Volume Provisioner for Kubernetes 1.5+
  2. `rbd-provisioner` is an out-of-tree dynamic provisioner for Kubernetes 1.5+.
  3. You can use it quickly & easily deploy ceph RBD storage that works almost
  4. anywhere.
  5. It works just like in-tree dynamic provisioner. For more information on how
  6. dynamic provisioning works, see [the docs](https://kubernetes.io/docs/concepts/storage/persistent-volumes/)
  7. or [this blog post](http://blog.kubernetes.io/2016/10/dynamic-provisioning-and-storage-in-kubernetes.html).
  8. ## Development
  9. Compile the provisioner
  10. ```console
  11. make
  12. ```
  13. Make the container image and push to the registry
  14. ```console
  15. make push
  16. ```
  17. ## Test instruction
  18. * Start Kubernetes local cluster
  19. See [Kubernetes](https://kubernetes.io/).
  20. * Create a Ceph admin secret
  21. ```bash
  22. ceph auth get client.admin 2>&1 |grep "key = " |awk '{print $3'} |xargs echo -n > /tmp/secret
  23. kubectl create secret generic ceph-admin-secret --from-file=/tmp/secret --namespace=kube-system
  24. ```
  25. * Create a Ceph pool and a user secret
  26. ```bash
  27. ceph osd pool create kube 8 8
  28. ceph auth add client.kube mon 'allow r' osd 'allow rwx pool=kube'
  29. ceph auth get-key client.kube > /tmp/secret
  30. kubectl create secret generic ceph-secret --from-file=/tmp/secret --namespace=kube-system
  31. ```
  32. * Start RBD provisioner
  33. The following example uses `rbd-provisioner-1` as the identity for the instance and assumes kubeconfig is at `/root/.kube`. The identity should remain the same if the provisioner restarts. If there are multiple provisioners, each should have a different identity.
  34. ```bash
  35. docker run -ti -v /root/.kube:/kube -v /var/run/kubernetes:/var/run/kubernetes --privileged --net=host quay.io/external_storage/rbd-provisioner /usr/local/bin/rbd-provisioner -master=http://127.0.0.1:8080 -kubeconfig=/kube/config -id=rbd-provisioner-1
  36. ```
  37. Alternatively, deploy it in kubernetes, see [deployment](deploy/README.md).
  38. * Create a RBD Storage Class
  39. Replace Ceph monitor's IP in [examples/class.yaml](examples/class.yaml) with your own and create storage class:
  40. ```bash
  41. kubectl create -f examples/class.yaml
  42. ```
  43. * Create a claim
  44. ```bash
  45. kubectl create -f examples/claim.yaml
  46. ```
  47. * Create a Pod using the claim
  48. ```bash
  49. kubectl create -f examples/test-pod.yaml
  50. ```
  51. ## Acknowledgements
  52. * This provisioner is extracted from [Kubernetes core](https://github.com/kubernetes/kubernetes) with some modifications for this project.