c5c18db1fdffa4659aa85b43e397e6172bd97c99
[it/test.git] / XTesting / kubespray / docs / kubernetes-apps / cephfs_provisioner.md
1 # CephFS Volume Provisioner for Kubernetes 1.5+
2
3 [![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)
4
5 Using Ceph volume client
6
7 ## Development
8
9 Compile the provisioner
10
11 ``` console
12 make
13 ```
14
15 Make the container image and push to the registry
16
17 ``` console
18 make push
19 ```
20
21 ## Test instruction
22
23 - Start Kubernetes local cluster
24
25 See [Kubernetes](https://kubernetes.io/)
26
27 - Create a Ceph admin secret
28
29 ``` bash
30 ceph auth get client.admin 2>&1 |grep "key = " |awk '{print  $3'} |xargs echo -n > /tmp/secret
31 kubectl create ns cephfs
32 kubectl create secret generic ceph-secret-admin --from-file=/tmp/secret --namespace=cephfs
33 ```
34
35 - Start CephFS provisioner
36
37 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.
38
39 ``` bash
40 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
41 ```
42
43 Alternatively, deploy it in kubernetes, see [deployment](deploy/README.md).
44
45 - Create a CephFS Storage Class
46
47 Replace Ceph monitor's IP in [example class](example/class.yaml) with your own and create storage class:
48
49 ``` bash
50 kubectl create -f example/class.yaml
51 ```
52
53 - Create a claim
54
55 ``` bash
56 kubectl create -f example/claim.yaml
57 ```
58
59 - Create a Pod using the claim
60
61 ``` bash
62 kubectl create -f example/test-pod.yaml
63 ```
64
65 ## Known limitations
66
67 - Kernel CephFS doesn't work with SELinux, setting SELinux label in Pod's securityContext will not work.
68 - Kernel CephFS doesn't support quota or capacity, capacity requested by PVC is not enforced or validated.
69 - Currently each Ceph user created by the provisioner has `allow r` MDS cap to permit CephFS mount.
70
71 ## Acknowledgement
72
73 Inspired by CephFS Manila provisioner and conversation with John Spray