Skip to content

Commit 0df9be5

Browse files
committed
doc: refine doc
1 parent f084312 commit 0df9be5

File tree

4 files changed

+19
-4
lines changed

4 files changed

+19
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ This is a repository for [NFS](https://en.wikipedia.org/wiki/Network_File_System
1818

1919
### Install driver on a Kubernetes cluster
2020
> [install NFS CSI driver on microk8s](https://microk8s.io/docs/nfs)
21-
- install by [kubectl](./docs/install-nfs-csi-driver.md)
22-
- install by [helm charts](./charts)
21+
- install via [helm charts](./charts)
22+
- install via [kubectl](./docs/install-nfs-csi-driver.md)
2323

2424
### Driver parameters
2525
Please refer to [`nfs.csi.k8s.io` driver parameters](./docs/driver-parameters.md)

deploy/example/nfs-provisioner/nginx-pod.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
apiVersion: v1
33
kind: PersistentVolume
44
metadata:
5+
annotations:
6+
pv.kubernetes.io/provisioned-by: nfs.csi.k8s.io
57
name: pv-nginx
68
spec:
79
capacity:
@@ -14,7 +16,9 @@ spec:
1416
csi:
1517
driver: nfs.csi.k8s.io
1618
readOnly: false
17-
volumeHandle: unique-volumeid # make sure it's a unique id in the cluster
19+
# volumeHandle format: {nfs-server-address}#{sub-dir-name}#{share-name}
20+
# make sure this value is unique for every share in the cluster
21+
volumeHandle: nfs-server.default.svc.cluster.local/share##
1822
volumeAttributes:
1923
server: nfs-server.default.svc.cluster.local
2024
share: /

deploy/example/pv-nfs-csi.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
apiVersion: v1
33
kind: PersistentVolume
44
metadata:
5+
annotations:
6+
pv.kubernetes.io/provisioned-by: nfs.csi.k8s.io
57
name: pv-nfs
68
spec:
79
capacity:
@@ -15,7 +17,9 @@ spec:
1517
csi:
1618
driver: nfs.csi.k8s.io
1719
readOnly: false
18-
volumeHandle: unique-volumeid # make sure it's a unique id in the cluster
20+
# volumeHandle format: {nfs-server-address}#{sub-dir-name}#{share-name}
21+
# make sure this value is unique for every share in the cluster
22+
volumeHandle: nfs-server.default.svc.cluster.local/share##
1923
volumeAttributes:
2024
server: nfs-server.default.svc.cluster.local
2125
share: /

docs/driver-parameters.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,18 @@ share | NFS share path | `/` | Yes |
1111
subDir | sub directory under nfs share | | No | if sub directory does not exist, this driver would create a new one
1212
mountPermissions | mounted folder permissions. The default is `0`, if set as non-zero, driver will perform `chmod` after mount | | No |
1313

14+
- VolumeID(`volumeHandle`) is the identifier of the volume handled by the driver, format of VolumeID:
15+
```
16+
{nfs-server-address}#{sub-dir-name}#{share-name}
17+
```
18+
> example: `nfs-server.default.svc.cluster.local/share#subdir#`
19+
1420
### PV/PVC usage (static provisioning)
1521
> [`PersistentVolume` example](../deploy/example/pv-nfs-csi.yaml)
1622
1723
Name | Meaning | Example Value | Mandatory | Default value
1824
--- | --- | --- | --- | ---
25+
volumeHandle | Specify a value the driver can use to uniquely identify the share in the cluster. | A recommended way to produce a unique value is to combine the nfs-server address, sub directory name and share name: `{nfs-server-address}#{sub-dir-name}#{share-name}`. | Yes |
1926
volumeAttributes.server | NFS Server address | domain name `nfs-server.default.svc.cluster.local` <br>or IP address `127.0.0.1` | Yes |
2027
volumeAttributes.share | NFS share path | `/` | Yes |
2128
volumeAttributes.mountPermissions | mounted folder permissions. The default is `0`, if set as non-zero, driver will perform `chmod` after mount | | No |

0 commit comments

Comments
 (0)