summaryrefslogtreecommitdiffstats
path: root/tutorials
diff options
context:
space:
mode:
authorleonwang <wanghui71@huawei.com>2018-02-03 09:27:38 +0000
committerleonwang <wanghui71@huawei.com>2018-02-03 09:27:50 +0000
commit561c0708b78eed8120b90f0221cd66730c9e8a74 (patch)
tree7727daa8a9eaaee927a3d087d1f0af7c3851c441 /tutorials
parent1dc4e57ae38ea5a4989aeb382c3450a26363ead5 (diff)
Add csi plugin ansible and tutorial document
As discussed on Compass4NFV meeting this week, we need to add the support for csi-plugin. So in this patch I extend nbp-ansible to support integrating with k8s using csi. All the detailed information can be found in documents. Besides, since opensds community has updated something in opensds ansible, we should update ours to keep up with the latest code. Change-Id: I238c7f7652b6a9c86cc9fcb24d9575d625c5f80a Signed-off-by: leonwang <wanghui71@huawei.com>
Diffstat (limited to 'tutorials')
-rw-r--r--tutorials/csi-plugin.md108
-rw-r--r--tutorials/flexvolume-plugin.md8
2 files changed, 113 insertions, 3 deletions
diff --git a/tutorials/csi-plugin.md b/tutorials/csi-plugin.md
new file mode 100644
index 0000000..e3b0174
--- /dev/null
+++ b/tutorials/csi-plugin.md
@@ -0,0 +1,108 @@
+## Prerequisite ##
+
+### ubuntu
+* Version information
+
+ ```
+ root@proxy:~# cat /etc/issue
+ Ubuntu 16.04.2 LTS \n \l
+ ```
+
+### docker
+* Version information
+
+ ```
+ root@proxy:~# docker version
+ Client:
+ Version: 1.12.6
+ API version: 1.24
+ Go version: go1.6.2
+ Git commit: 78d1802
+ Built: Tue Jan 31 23:35:14 2017
+ OS/Arch: linux/amd64
+
+ Server:
+ Version: 1.12.6
+ API version: 1.24
+ Go version: go1.6.2
+ Git commit: 78d1802
+ Built: Tue Jan 31 23:35:14 2017
+ OS/Arch: linux/amd64
+ ```
+
+### [kubernetes](https://github.com/kubernetes/kubernetes) local cluster
+* You can startup the lastest k8s local cluster by executing commands blow:
+
+ ```
+ cd $HOME
+ git clone https://github.com/kubernetes/kubernetes.git
+ cd $HOME/kubernetes
+ make
+ echo alias kubectl='$HOME/kubernetes/cluster/kubectl.sh' >> /etc/profile
+ ALLOW_PRIVILEGED=true FEATURE_GATES=CSIPersistentVolume=true,MountPropagation=true RUNTIME_CONFIG="storage.k8s.io/v1alpha1=true" LOG_LEVEL=5 hack/local-up-cluster.sh
+ ```
+
+### [opensds](https://github.com/opensds/opensds) local cluster
+* For testing purposes you can deploy OpenSDS referring the [OpenSDS Cluster Installation through Ansible](https://github.com/opensds/opensds/wiki/OpenSDS-Cluster-Installation-through-Ansible) wiki. Besides, you need to deploy opensds csi plugin refering to ```nbp-ansible/README.md```.
+
+## Testing steps ##
+
+* Change the workplace
+
+ ```
+ cd /opt/opensds-k8s-v0.1.0-linux-amd64
+ ```
+
+* Configure opensds endpoint IP
+
+ ```
+ vim csi/deploy/kubernetes/csi-configmap-opensdsplugin.yaml
+ ```
+
+ The IP (127.0.0.1) should be replaced with the opensds actual endpoint IP.
+ ```yaml
+ kind: ConfigMap
+ apiVersion: v1
+ metadata:
+ name: csi-configmap-opensdsplugin
+ data:
+ opensdsendpoint: http://127.0.0.1:50040
+ ```
+
+* Create opensds CSI pods.
+
+ ```
+ kubectl create -f csi/deploy/kubernetes
+ ```
+
+ After this three pods can be found by ```kubectl get pods``` like below:
+
+ - csi-provisioner-opensdsplugin
+ - csi-attacher-opensdsplugin
+ - csi-nodeplugin-opensdsplugin
+
+ You can find more design details from
+ [CSI Volume Plugins in Kubernetes Design Doc](https://github.com/kubernetes/community/blob/master/contributors/design-proposals/storage/container-storage-interface.md)
+
+* Create example nginx application
+
+ ```
+ kubectl create -f csi/examples/kubernetes/nginx.yaml
+ ```
+
+ This example will mount a opensds volume into ```/var/lib/www/html```.
+
+ You can use the following command to inspect into nginx container to verify it.
+
+ ```
+ docker exec -it <nginx container id> /bin/bash
+ ```
+
+## Clean up steps ##
+
+Clean up example nginx application and opensds CSI pods by the following commands.
+
+```
+kubectl delete -f csi/examples/kubernetes/nginx.yaml
+kubectl delete -f csi/deploy/kubernetes
+```
diff --git a/tutorials/flexvolume-plugin.md b/tutorials/flexvolume-plugin.md
index 450acd5..c85d752 100644
--- a/tutorials/flexvolume-plugin.md
+++ b/tutorials/flexvolume-plugin.md
@@ -1,4 +1,5 @@
## Prerequisite ##
+
### ubuntu
* Version information
@@ -6,6 +7,7 @@
root@proxy:~# cat /etc/issue
Ubuntu 16.04.2 LTS \n \l
```
+
### docker
* Version information
@@ -55,14 +57,14 @@
* Create service account, role and bind them.
```
- cd /opt/opensds-k8s-linux-amd64/provisioner
+ cd /opt/opensds-k8s-{release version}-linux-amd64/provisioner
kubectl create -f serviceaccount.yaml
kubectl create -f clusterrole.yaml
kubectl create -f clusterrolebinding.yaml
```
* Change the opensds endpoint IP in pod-provisioner.yaml
-The IP (192.168.56.106) should be replaced with the OpenSDS osdslet actual endpoint IP.
+The IP ```192.168.56.106``` should be replaced with the OpenSDS osdslet actual endpoint IP.
```yaml
kind: Pod
apiVersion: v1
@@ -72,7 +74,7 @@ The IP (192.168.56.106) should be replaced with the OpenSDS osdslet actual endpo
serviceAccount: opensds-provisioner
containers:
- name: opensds-provisioner
- image: opensdsio/opensds-provisioner
+ image: opensdsio/opensds-provisioner:latest
securityContext:
args:
- "-endpoint=http://192.168.56.106:50040" # should be replaced