Skip to content

Commit 8c36043

Browse files
committed
Update readme doc
1 parent 3348ad0 commit 8c36043

File tree

2 files changed

+33
-11
lines changed

2 files changed

+33
-11
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,17 @@ The following examples assume that the CSI hostpath driver has been deployed and
2828
- [Volume snapshots](docs/example-snapshots-1.17-and-later.md)
2929
- [Inline ephemeral volumes](docs/example-ephemeral.md)
3030

31-
## Building the binaries
31+
## Build and Test locally
32+
### Building the binaries
3233
If you want to build the driver yourself, you can do so with the following command from the root directory:
3334

3435
```shell
3536
make
3637
```
3738

39+
### Test hostpath driver
40+
See [doc](./pkg/hostpath/README.md)
41+
3842
## Development
3943

4044
### Updating sidecar images

pkg/hostpath/README.md

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,70 @@
77
$ make
88
```
99

10+
### Set endpoint
11+
```
12+
$ endpoint=unix:///tmp/csi.sock # unix (default)
13+
$ #endpoint=tcp://127.0.0.1:10000 # tcp
14+
```
15+
1016
### Start Hostpath driver
1117
```
12-
$ sudo ./bin/hostpathplugin --endpoint tcp://127.0.0.1:10000 --nodeid CSINode -v=5
18+
$ sudo ./bin/hostpathplugin --endpoint $endpoint --nodeid CSINode -v=5
1319
```
1420

1521
### Test using csc
1622
Get ```csc``` tool from https://github.com/rexray/gocsi/tree/master/csc
1723

1824
#### Get plugin info
1925
```
20-
$ csc identity plugin-info --endpoint tcp://127.0.0.1:10000
21-
"csi-hostpath" "0.1.0"
26+
$ sudo csc identity plugin-info --endpoint $endpoint
27+
"hostpath.csi.k8s.io" "v1.x.x-xx-xxx"
2228
```
2329

2430
#### Create a volume
2531
```
26-
$ csc controller new --endpoint tcp://127.0.0.1:10000 --cap 1,block CSIVolumeName
32+
$ sudo csc controller new --endpoint $endpoint --cap 1,block --req-bytes 10240000 CSIVolumeName
2733
CSIVolumeID
2834
```
2935

3036
#### Delete a volume
3137
```
32-
$ csc controller del --endpoint tcp://127.0.0.1:10000 CSIVolumeID
38+
$ sudo csc controller del --endpoint $endpoint CSIVolumeID
3339
CSIVolumeID
3440
```
3541

3642
#### Validate volume capabilities
3743
```
38-
$ csc controller validate-volume-capabilities --endpoint tcp://127.0.0.1:10000 --cap 1,block CSIVolumeID
39-
CSIVolumeID true
44+
$ sudo csc controller validate-volume-capabilities --endpoint $endpoint --cap 1,block CSIVolumeID
45+
CSIVolumeID volume_capabilities:<block:<> access_mode:<mode:SINGLE_NODE_WRITER > >
46+
```
47+
48+
#### NodeStage a volume
49+
```
50+
$ sudo csc node stage --endpoint $endpoint --cap 1,block --staging-target-path /mnt/hostpath CSIVolumeID
51+
CSIVolumeID
52+
```
53+
54+
#### NodeUnstage a volume
55+
```
56+
$ sudo csc node unstage --endpoint $endpoint --cap 1,block --staging-target-path /mnt/hostpath CSIVolumeID
57+
CSIVolumeID
4058
```
4159

4260
#### NodePublish a volume
4361
```
44-
$ csc node publish --endpoint tcp://127.0.0.1:10000 --cap 1,block --target-path /mnt/hostpath CSIVolumeID
62+
$ sudo csc node publish --endpoint $endpoint --cap 1,block --staging-target-path /mnt/hostpath --target-path /mnt/hostpath CSIVolumeID
4563
CSIVolumeID
4664
```
4765

4866
#### NodeUnpublish a volume
4967
```
50-
$ csc node unpublish --endpoint tcp://127.0.0.1:10000 --target-path /mnt/hostpath CSIVolumeID
68+
$ sudo csc node unpublish --endpoint $endpoint --target-path /mnt/hostpath CSIVolumeID
5169
CSIVolumeID
5270
```
5371

5472
#### Get NodeInfo
5573
```
56-
$ csc node get-info --endpoint tcp://127.0.0.1:10000
74+
$ sudo csc node get-info --endpoint $endpoint
5775
CSINode
5876
```

0 commit comments

Comments
 (0)