Skip to content

Commit e2aa33b

Browse files
committed
Add info about plugin compatibility and features
1 parent 6c3e1fd commit e2aa33b

File tree

1 file changed

+40
-50
lines changed

1 file changed

+40
-50
lines changed

README.md

Lines changed: 40 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,79 +1,69 @@
11
# CSI NFS driver
22

3-
## Kubernetes
4-
### Requirements
3+
## Overview
54

6-
The folllowing feature gates and runtime config have to be enabled to deploy the driver
5+
This is a repository for [NFS](https://en.wikipedia.org/wiki/Network_File_System) [CSI](https://kubernetes-csi.github.io/docs/) Driver.
6+
Currently it implements bare minimum of the CSI and is in the alpha state of the development.
77

8-
```
9-
FEATURE_GATES=CSIPersistentVolume=true,MountPropagation=true
10-
RUNTIME_CONFIG="storage.k8s.io/v1alpha1=true"
11-
```
8+
#### CSI Feature matrix
129

13-
Mountprogpation requries support for privileged containers. So, make sure privileged containers are enabled in the cluster.
10+
| **nfs.csi.k8s.io** | Min K8s version | CSI versions compatibility | Dynamic Provisioning | Resize | Snapshots | Raw Block | AccessModes | Status |
11+
|--------------------|-----------------|----------------------------|----------------------|--------|-----------|-----------|--------------------------|--------|
12+
|master | 1.14 | v1.1 | no | no | no | no | Read/Write Multiple Pods | Alpha |
13+
|v1.0.0 | 1.14 | v1.1 | no | no | no | no | Read/Write Multiple Pods | Alpha |
1414

15-
### Example local-up-cluster.sh
15+
## Requirements
1616

17-
```ALLOW_PRIVILEGED=true FEATURE_GATES=CSIPersistentVolume=true,MountPropagation=true RUNTIME_CONFIG="storage.k8s.io/v1alpha1=true" LOG_LEVEL=5 hack/local-up-cluster.sh```
17+
The CSI NFS driver requires Kubernetes cluster of version 1.14 or newer and
18+
preexisting NFS server, whether it is deployed on cluster or provisioned
19+
independently. The plugin itself provides only a communication layer between
20+
resources in the cluser and the NFS server.
1821

19-
### Deploy
22+
## Example
2023

21-
```kubectl -f deploy/kubernetes create```
24+
There are multiple ways to create a kubernetes cluster, the NFS CSI plugin
25+
should work invariantly of your cluster setup. Very simple way of getting
26+
a local environment for testing can be achieved using for example
27+
[kind](https://github.com/kubernetes-sigs/kind).
2228

23-
### Example Nginx application
24-
Please update the NFS Server & share information in nginx.yaml file.
29+
There are also multiple different NFS servers you can use for testing of
30+
the plugin, the major versions of the protocol v2, v3 and v4 should be supported
31+
by the current implementation.
2532

26-
```kubectl -f examples/kubernetes/nginx.yaml create```
33+
The example assumes you have your cluster created (e.g. `kind create cluster`)
34+
and working NFS server (e.g. https://github.com/rootfs/nfs-ganesha-docker)
2735

28-
## Using CSC tool
36+
#### Deploy
2937

30-
### Build nfsplugin
38+
Deploy the NFS plugin along with the `CSIDriver` info.
3139
```
32-
$ make nfs
40+
kubectl -f deploy/kubernetes create
3341
```
3442

35-
### Start NFS driver
36-
```
37-
$ sudo ./_output/nfsplugin --endpoint tcp://127.0.0.1:10000 --nodeid CSINode -v=5
38-
```
43+
#### Example Nginx application
3944

40-
## Test
41-
Get ```csc``` tool from https://github.com/rexray/gocsi/tree/master/csc
45+
The [/examples/kubernetes/nginx.yaml](/examples/kubernetes/nginx.yaml) contains a `PersistentVolume`,
46+
`PersistentVolumeClaim` and an nginx `Pod` mounting the NFS volume under `/var/www`.
4247

43-
#### Get plugin info
44-
```
45-
$ csc identity plugin-info --endpoint tcp://127.0.0.1:10000
46-
"NFS" "0.1.0"
47-
```
48+
You will need to update the NFS Server IP and the share information under
49+
`volumeAttributes` inside `PersistentVolume` in `nginx.yaml` file to match your
50+
NFS server public end point and configuration. You can also provide additional
51+
`mountOptions`, such as protocol version, in the `PersistentVolume` `spec`
52+
relevant for your NFS Server.
4853

49-
#### NodePublish a volume
5054
```
51-
$ export NFS_SERVER="Your Server IP (Ex: 10.10.10.10)"
52-
$ export NFS_SHARE="Your NFS share"
53-
$ csc node publish --endpoint tcp://127.0.0.1:10000 --target-path /mnt/nfs --attrib server=$NFS_SERVER --attrib share=$NFS_SHARE nfstestvol
54-
nfstestvol
55+
kubectl -f examples/kubernetes/nginx.yaml create
5556
```
5657

57-
#### NodeUnpublish a volume
58-
```
59-
$ csc node unpublish --endpoint tcp://127.0.0.1:10000 --target-path /mnt/nfs nfstestvol
60-
nfstestvol
61-
```
62-
63-
#### Get NodeID
64-
```
65-
$ csc node get-id --endpoint tcp://127.0.0.1:10000
66-
CSINode
67-
```
6858
## Running Kubernetes End To End tests on an NFS Driver
6959

7060
First, stand up a local cluster `ALLOW_PRIVILEGED=1 hack/local-up-cluster.sh` (from your Kubernetes repo)
7161
For Fedora/RHEL clusters, the following might be required:
72-
```
73-
sudo chown -R $USER:$USER /var/run/kubernetes/
74-
sudo chown -R $USER:$USER /var/lib/kubelet
75-
sudo chcon -R -t svirt_sandbox_file_t /var/lib/kubelet
76-
```
62+
```
63+
sudo chown -R $USER:$USER /var/run/kubernetes/
64+
sudo chown -R $USER:$USER /var/lib/kubelet
65+
sudo chcon -R -t svirt_sandbox_file_t /var/lib/kubelet
66+
```
7767
If you are plannig to test using your own private image, you could either install your nfs driver using your own set of YAML files, or edit the existing YAML files to use that private image.
7868

7969
When using the [existing set of YAML files](https://github.com/kubernetes-csi/csi-driver-nfs/tree/master/deploy/kubernetes), you would edit the [csi-attacher-nfsplugin.yaml](https://github.com/kubernetes-csi/csi-driver-nfs/blob/master/deploy/kubernetes/csi-attacher-nfsplugin.yaml#L46) and [csi-nodeplugin-nfsplugin.yaml](https://github.com/kubernetes-csi/csi-driver-nfs/blob/master/deploy/kubernetes/csi-nodeplugin-nfsplugin.yaml#L45) files to include your private image instead of the default one. After editing these files, skip to step 3 of the following steps.

0 commit comments

Comments
 (0)