Skip to content

Commit c197f2a

Browse files
authored
Merge pull request #27 from wozniakjan/issue3/update_readme
Add basic info to README about the plugin compatibility and features
2 parents 83a94b8 + 398baaa commit c197f2a

File tree

3 files changed

+45
-53
lines changed

3 files changed

+45
-53
lines changed

README.md

Lines changed: 43 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,87 +1,79 @@
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 spec](https://github.com/container-storage-interface/spec) and is in the alpha state
7+
of the development.
78

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

13-
Mountprogpation requries support for privileged containers. So, make sure privileged containers are enabled in the cluster.
11+
| **nfs.csi.k8s.io** | K8s version compatibility | CSI versions compatibility | Dynamic Provisioning | Resize | Snapshots | Raw Block | AccessModes | Status |
12+
|--------------------|---------------------------|----------------------------|----------------------|--------|-----------|-----------|--------------------------|------------------------------------------------------------------------------|
13+
|master | 1.14 + | v1.0 + | no | no | no | no | Read/Write Multiple Pods | Alpha |
14+
|v2.0.0 | 1.14 + | v1.0 + | no | no | no | no | Read/Write Multiple Pods | Alpha |
15+
|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) |
1416

15-
### Example local-up-cluster.sh
17+
## Requirements
1618

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

19-
### Deploy
24+
## Example
2025

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

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

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

28-
## Using CSC tool
38+
#### Deploy
2939

30-
### Build nfsplugin
40+
Deploy the NFS plugin along with the `CSIDriver` info.
3141
```
32-
$ make nfs
42+
kubectl -f deploy/kubernetes create
3343
```
3444

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

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

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

49-
#### NodePublish a volume
5056
```
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
57+
kubectl -f examples/kubernetes/nginx.yaml create
5558
```
5659

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

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

7971
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.
8072

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

8375
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 .`
76+
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 .`
8577
3) Install the Driver: `kubectl create -f deploy/kubernetes`
8678
4) Build E2E test binary: `make build-tests`
8779
5) Run E2E Tests using the following command: `./bin/tests --ginkgo.v --ginkgo.progress --kubeconfig=/var/run/kubernetes/admin.kubeconfig`

deploy/kubernetes/csi-nodeplugin-nfsplugin.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ spec:
4242
capabilities:
4343
add: ["SYS_ADMIN"]
4444
allowPrivilegeEscalation: true
45-
image: quay.io/k8scsi/nfsplugin:v1.0.0
45+
image: quay.io/k8scsi/nfsplugin:v2.0.0
4646
args :
4747
- "--nodeid=$(NODE_ID)"
4848
- "--endpoint=$(CSI_ENDPOINT)"

pkg/nfs/nfs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const (
4040
)
4141

4242
var (
43-
version = "1.0.0"
43+
version = "2.0.0"
4444
)
4545

4646
func NewNFSdriver(nodeID, endpoint string) *nfsDriver {

0 commit comments

Comments
 (0)