c12s-kubespray/docs/kubernetes-apps/cephfs_provisioner.md

74 lines
2.1 KiB
Markdown
Raw Normal View History

# CephFS Volume Provisioner for Kubernetes 1.5+
2018-02-13 01:55:59 +00:00
[![Docker Repository on Quay](https://quay.io/repository/external_storage/cephfs-provisioner/status "Docker Repository on Quay")](https://quay.io/repository/external_storage/cephfs-provisioner)
Using Ceph volume client
## Development
2018-02-13 01:55:59 +00:00
Compile the provisioner
``` console
make
```
Make the container image and push to the registry
``` console
make push
```
## Test instruction
2018-02-13 01:55:59 +00:00
- Start Kubernetes local cluster
2018-02-13 01:55:59 +00:00
See [Kubernetes](https://kubernetes.io/)
2018-02-13 01:55:59 +00:00
- Create a Ceph admin secret
2018-02-13 01:55:59 +00:00
``` bash
ceph auth get client.admin 2>&1 |grep "key = " |awk '{print $3'} |xargs echo -n > /tmp/secret
kubectl create ns cephfs
kubectl create secret generic ceph-secret-admin --from-file=/tmp/secret --namespace=cephfs
```
- Start CephFS provisioner
2018-02-13 01:55:59 +00:00
The following example uses `cephfs-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.
``` bash
2018-09-30 04:03:27 +00:00
docker run -ti -v /root/.kube:/kube -v /var/run/kubernetes:/var/run/kubernetes --privileged --net=host cephfs-provisioner /usr/local/bin/cephfs-provisioner -master=http://127.0.0.1:8080 -kubeconfig=/kube/config -id=cephfs-provisioner-1
2018-02-13 01:55:59 +00:00
```
Alternatively, deploy it in kubernetes, see [deployment](deploy/README.md).
- Create a CephFS Storage Class
2018-02-13 01:55:59 +00:00
Replace Ceph monitor's IP in [example class](example/class.yaml) with your own and create storage class:
2018-02-13 01:55:59 +00:00
``` bash
kubectl create -f example/class.yaml
```
- Create a claim
2018-02-13 01:55:59 +00:00
``` bash
kubectl create -f example/claim.yaml
```
- Create a Pod using the claim
2018-02-13 01:55:59 +00:00
``` bash
kubectl create -f example/test-pod.yaml
```
## Known limitations
2018-02-13 01:55:59 +00:00
- Kernel CephFS doesn't work with SELinux, setting SELinux label in Pod's securityContext will not work.
- Kernel CephFS doesn't support quota or capacity, capacity requested by PVC is not enforced or validated.
- Currently each Ceph user created by the provisioner has `allow r` MDS cap to permit CephFS mount.
2018-02-13 01:55:59 +00:00
## Acknowledgement
2018-02-13 01:55:59 +00:00
Inspired by CephFS Manila provisioner and conversation with John Spray