2018-01-09 18:57:14 +00:00
|
|
|
# CSI NFS driver
|
|
|
|
|
|
|
|
|
|
|
|
## Kubernetes
|
|
|
|
### Requirements
|
|
|
|
|
|
|
|
The folllowing feature gates and runtime config have to be enabled to deploy the driver
|
|
|
|
|
|
|
|
```
|
|
|
|
FEATURE_GATES=CSIPersistentVolume=true,MountPropagation=true
|
|
|
|
RUNTIME_CONFIG="storage.k8s.io/v1alpha1=true"
|
|
|
|
```
|
|
|
|
|
|
|
|
Mountprogpation requries support for privileged containers. So, make sure privileged containers are enabled in the cluster.
|
|
|
|
|
|
|
|
### Example local-up-cluster.sh
|
|
|
|
|
|
|
|
```ALLOW_PRIVILEGED=true FEATURE_GATES=CSIPersistentVolume=true,MountPropagation=true RUNTIME_CONFIG="storage.k8s.io/v1alpha1=true" LOG_LEVEL=5 hack/local-up-cluster.sh```
|
|
|
|
|
|
|
|
### Deploy
|
|
|
|
|
|
|
|
```kubectl -f deploy/kubernetes create```
|
|
|
|
|
|
|
|
### Example Nginx application
|
|
|
|
Please update the NFS Server & share information in nginx.yaml file.
|
|
|
|
|
|
|
|
```kubectl -f examples/kubernetes/nginx.yaml create```
|
|
|
|
|
|
|
|
## Using CSC tool
|
|
|
|
|
2018-02-15 13:50:31 +00:00
|
|
|
### Build nfsplugin
|
|
|
|
```
|
|
|
|
$ make nfs
|
|
|
|
```
|
|
|
|
|
2018-01-09 18:57:14 +00:00
|
|
|
### Start NFS driver
|
|
|
|
```
|
2018-02-15 13:50:31 +00:00
|
|
|
$ sudo ./_output/nfsplugin --endpoint tcp://127.0.0.1:10000 --nodeid CSINode -v=5
|
2018-01-09 18:57:14 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Test
|
2018-07-18 14:47:22 +00:00
|
|
|
Get ```csc``` tool from https://github.com/rexray/gocsi/tree/master/csc
|
2018-01-09 18:57:14 +00:00
|
|
|
|
|
|
|
#### Get plugin info
|
|
|
|
```
|
2018-02-15 13:50:31 +00:00
|
|
|
$ csc identity plugin-info --endpoint tcp://127.0.0.1:10000
|
2018-01-09 18:57:14 +00:00
|
|
|
"NFS" "0.1.0"
|
|
|
|
```
|
|
|
|
|
|
|
|
#### NodePublish a volume
|
|
|
|
```
|
|
|
|
$ export NFS_SERVER="Your Server IP (Ex: 10.10.10.10)"
|
|
|
|
$ export NFS_SHARE="Your NFS share"
|
2018-02-15 13:50:31 +00:00
|
|
|
$ csc node publish --endpoint tcp://127.0.0.1:10000 --target-path /mnt/nfs --attrib server=$NFS_SERVER --attrib share=$NFS_SHARE nfstestvol
|
2018-01-09 18:57:14 +00:00
|
|
|
nfstestvol
|
|
|
|
```
|
|
|
|
|
|
|
|
#### NodeUnpublish a volume
|
|
|
|
```
|
2018-02-15 13:50:31 +00:00
|
|
|
$ csc node unpublish --endpoint tcp://127.0.0.1:10000 --target-path /mnt/nfs nfstestvol
|
2018-01-09 18:57:14 +00:00
|
|
|
nfstestvol
|
|
|
|
```
|
|
|
|
|
|
|
|
#### Get NodeID
|
|
|
|
```
|
2018-02-15 13:50:31 +00:00
|
|
|
$ csc node get-id --endpoint tcp://127.0.0.1:10000
|
2018-01-09 18:57:14 +00:00
|
|
|
CSINode
|
|
|
|
```
|
|
|
|
|