|
7 | 7 | $ make
|
8 | 8 | ```
|
9 | 9 |
|
| 10 | +### Set endpoint |
| 11 | +``` |
| 12 | +$ endpoint=unix:///tmp/csi.sock # unix (default) |
| 13 | +$ #endpoint=tcp://127.0.0.1:10000 # tcp |
| 14 | +``` |
| 15 | + |
10 | 16 | ### Start Hostpath driver
|
11 | 17 | ```
|
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 |
13 | 19 | ```
|
14 | 20 |
|
15 | 21 | ### Test using csc
|
16 | 22 | Get ```csc``` tool from https://github.com/rexray/gocsi/tree/master/csc
|
17 | 23 |
|
18 | 24 | #### Get plugin info
|
19 | 25 | ```
|
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" |
22 | 28 | ```
|
23 | 29 |
|
24 | 30 | #### Create a volume
|
25 | 31 | ```
|
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 |
27 | 33 | CSIVolumeID
|
28 | 34 | ```
|
29 | 35 |
|
30 | 36 | #### Delete a volume
|
31 | 37 | ```
|
32 |
| -$ csc controller del --endpoint tcp://127.0.0.1:10000 CSIVolumeID |
| 38 | +$ sudo csc controller del --endpoint $endpoint CSIVolumeID |
33 | 39 | CSIVolumeID
|
34 | 40 | ```
|
35 | 41 |
|
36 | 42 | #### Validate volume capabilities
|
37 | 43 | ```
|
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 |
40 | 58 | ```
|
41 | 59 |
|
42 | 60 | #### NodePublish a volume
|
43 | 61 | ```
|
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 |
45 | 63 | CSIVolumeID
|
46 | 64 | ```
|
47 | 65 |
|
48 | 66 | #### NodeUnpublish a volume
|
49 | 67 | ```
|
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 |
51 | 69 | CSIVolumeID
|
52 | 70 | ```
|
53 | 71 |
|
54 | 72 | #### Get NodeInfo
|
55 | 73 | ```
|
56 |
| -$ csc node get-info --endpoint tcp://127.0.0.1:10000 |
| 74 | +$ sudo csc node get-info --endpoint $endpoint |
57 | 75 | CSINode
|
58 | 76 | ```
|
0 commit comments