2018-01-10 18:22:32 +00:00
|
|
|
# Ceph CSI
|
|
|
|
[Container Storage Interface (CSI)](https://github.com/container-storage-interface/) driver, provisioner, and attacher for Ceph RBD and CephFS
|
|
|
|
|
2018-02-06 18:30:05 +00:00
|
|
|
# Prerequisite
|
|
|
|
|
|
|
|
## Enable Mount Propagation in Docker
|
|
|
|
|
|
|
|
Comment out `MountFlags=slave` in docker systemd service then restart docker service.
|
|
|
|
```bash
|
|
|
|
# systemctl daemon-reload
|
|
|
|
# systemctl restart docker
|
|
|
|
```
|
|
|
|
|
|
|
|
## Enable Kubernetes Feature Gates
|
|
|
|
|
|
|
|
Enable features `MountPropagation=true,CSIPersistentVolume=true` and runtime config `storage.k8s.io/v1alpha1=true`
|
|
|
|
|
2018-01-10 18:22:32 +00:00
|
|
|
# Build
|
|
|
|
|
2018-02-06 18:30:05 +00:00
|
|
|
```bash
|
|
|
|
# make container
|
|
|
|
```
|
|
|
|
|
2018-01-10 18:22:32 +00:00
|
|
|
# Test
|
|
|
|
|
2018-02-06 18:30:05 +00:00
|
|
|
## Start rbdplugin and driver registrar
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# kubectl create -f deploy/kubernetes/rbdplugin.yaml
|
|
|
|
```
|
|
|
|
|
|
|
|
### Start CSI external volume provisioner
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# kubectl create -f deploy/kubernetes/csi-provisioner.yaml
|
|
|
|
```
|
|
|
|
|
|
|
|
### Start CSI external volume attacher
|
|
|
|
|
|
|
|
```
|
|
|
|
# kubectl create -f deploy/kubernetes/csi-attacher.yaml
|
|
|
|
```
|
|
|
|
|
|
|
|
### Verify all componets are ready
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# kubectl get pod
|
|
|
|
NAME READY STATUS RESTARTS AGE
|
|
|
|
csi-attacher-0 1/1 Running 0 6s
|
|
|
|
csi-nodeplugin-rbdplugin-kwhhc 2/2 Running 0 6m
|
|
|
|
csi-provisioner-0 1/1 Running 0 1m
|
|
|
|
```
|
|
|
|
|
|
|
|
### Create a CSI storage class
|
|
|
|
|
2018-02-06 18:30:05 +00:00
|
|
|
Replace Ceph mon and secrets in [examples/sc.yaml](examples/sc.yaml)
|
|
|
|
|
|
|
|
```bash
|
|
|
|
# kubectl create -f examples/sc.yaml
|
|
|
|
```
|
2018-02-06 18:30:05 +00:00
|
|
|
|
|
|
|
### Create a PVC
|
|
|
|
|
2018-02-06 18:30:05 +00:00
|
|
|
```bash
|
|
|
|
# kubectl create -f examples/pvc.yaml
|
|
|
|
```
|
|
|
|
|
2018-02-06 18:30:05 +00:00
|
|
|
### Create a Pod
|
2018-01-10 18:22:32 +00:00
|
|
|
|
2018-02-06 18:30:05 +00:00
|
|
|
```bash
|
|
|
|
# kubectl create -f examples/pod.yaml
|
|
|
|
```
|