Skip to content

Commit ad04616

Browse files
committed
Add info about plugin compatibility and features
1 parent 1104130 commit ad04616

File tree

1 file changed

+42
-51
lines changed

1 file changed

+42
-51
lines changed

README.md

Lines changed: 42 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,78 @@
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** | K8s version compatibility | CSI versions compatibility | Dynamic Provisioning | Resize | Snapshots | Raw Block | AccessModes | Status |
11+
|--------------------|---------------------------|----------------------------|----------------------|--------|-----------|-----------|--------------------------|------------------------------------------------------------------------------|
12+
|master | 1.14 + | v1.0 + | no | no | no | no | Read/Write Multiple Pods | Alpha |
13+
|v2.0.0 | 1.14 + | v1.0 + | no | no | no | no | Read/Write Multiple Pods | Alpha |
14+
|v1.0.0 | 1.9 - 1.15 | v1.0 | no | no | no | no | Read/Write Multiple Pods | [deprecated](https://github.com/kubernetes-csi/drivers/tree/master/pkg/nfs) |
1415

15-
### Example local-up-cluster.sh
16+
## Requirements
1617

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```
18+
The CSI NFS driver requires Kubernetes cluster of version 1.14 or newer and
19+
preexisting NFS server, whether it is deployed on cluster or provisioned
20+
independently. The plugin itself provides only a communication layer between
21+
resources in the cluser and the NFS server.
1822

19-
### Deploy
23+
## Example
2024

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

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

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

28-
## Using CSC tool
37+
#### Deploy
2938

30-
### Build nfsplugin
39+
Deploy the NFS plugin along with the `CSIDriver` info.
3140
```
32-
$ make nfs
41+
kubectl -f deploy/kubernetes create
3342
```
3443

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

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

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

49-
#### NodePublish a volume
5055
```
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
56+
kubectl -f examples/kubernetes/nginx.yaml create
5557
```
5658

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-
```
6859
## Running Kubernetes End To End tests on an NFS Driver
6960

7061
First, stand up a local cluster `ALLOW_PRIVILEGED=1 hack/local-up-cluster.sh` (from your Kubernetes repo)
7162
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-
```
63+
```
64+
sudo chown -R $USER:$USER /var/run/kubernetes/
65+
sudo chown -R $USER:$USER /var/lib/kubelet
66+
sudo chcon -R -t svirt_sandbox_file_t /var/lib/kubelet
67+
```
7768
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.
7869

7970
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.
8071

8172
If you already have a driver installed, skip to step 4 of the following steps.
8273

8374
1) Build the nfs driver by running `make`
84-
2) Create NFS Driver Image, where the image tag would be whatever that is required by your YAML deployment files `docker build -t quay.io/k8scsi/nfsplugin:v1.0.0 .`
75+
2) Create NFS Driver Image, where the image tag would be whatever that is required by your YAML deployment files `docker build -t quay.io/k8scsi/nfsplugin:v2.0.0 .`
8576
3) Install the Driver: `kubectl create -f deploy/kubernetes`
8677
4) Build E2E test binary: `make build-tests`
8778
5) Run E2E Tests using the following command: `./bin/tests --ginkgo.v --ginkgo.progress --kubeconfig=/var/run/kubernetes/admin.kubeconfig`

0 commit comments

Comments
 (0)