Skip to content

Commit

Permalink
Update readme doc
Browse files Browse the repository at this point in the history
  • Loading branch information
astraw99 committed Oct 6, 2023
1 parent 3348ad0 commit 8c36043
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 11 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ The following examples assume that the CSI hostpath driver has been deployed and
- [Volume snapshots](docs/example-snapshots-1.17-and-later.md)
- [Inline ephemeral volumes](docs/example-ephemeral.md)

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

```shell
make
```

### Test hostpath driver
See [doc](./pkg/hostpath/README.md)

## Development

### Updating sidecar images
Expand Down
38 changes: 28 additions & 10 deletions pkg/hostpath/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,52 +7,70 @@
$ make
```

### Set endpoint
```
$ endpoint=unix:///tmp/csi.sock # unix (default)
$ #endpoint=tcp://127.0.0.1:10000 # tcp
```

### Start Hostpath driver
```
$ sudo ./bin/hostpathplugin --endpoint tcp://127.0.0.1:10000 --nodeid CSINode -v=5
$ sudo ./bin/hostpathplugin --endpoint $endpoint --nodeid CSINode -v=5
```

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

#### Get plugin info
```
$ csc identity plugin-info --endpoint tcp://127.0.0.1:10000
"csi-hostpath" "0.1.0"
$ sudo csc identity plugin-info --endpoint $endpoint
"hostpath.csi.k8s.io" "v1.x.x-xx-xxx"
```

#### Create a volume
```
$ csc controller new --endpoint tcp://127.0.0.1:10000 --cap 1,block CSIVolumeName
$ sudo csc controller new --endpoint $endpoint --cap 1,block --req-bytes 10240000 CSIVolumeName
CSIVolumeID
```

#### Delete a volume
```
$ csc controller del --endpoint tcp://127.0.0.1:10000 CSIVolumeID
$ sudo csc controller del --endpoint $endpoint CSIVolumeID
CSIVolumeID
```

#### Validate volume capabilities
```
$ csc controller validate-volume-capabilities --endpoint tcp://127.0.0.1:10000 --cap 1,block CSIVolumeID
CSIVolumeID true
$ sudo csc controller validate-volume-capabilities --endpoint $endpoint --cap 1,block CSIVolumeID
CSIVolumeID volume_capabilities:<block:<> access_mode:<mode:SINGLE_NODE_WRITER > >
```

#### NodeStage a volume
```
$ sudo csc node stage --endpoint $endpoint --cap 1,block --staging-target-path /mnt/hostpath CSIVolumeID
CSIVolumeID
```

#### NodeUnstage a volume
```
$ sudo csc node unstage --endpoint $endpoint --cap 1,block --staging-target-path /mnt/hostpath CSIVolumeID
CSIVolumeID
```

#### NodePublish a volume
```
$ csc node publish --endpoint tcp://127.0.0.1:10000 --cap 1,block --target-path /mnt/hostpath CSIVolumeID
$ sudo csc node publish --endpoint $endpoint --cap 1,block --staging-target-path /mnt/hostpath --target-path /mnt/hostpath CSIVolumeID
CSIVolumeID
```

#### NodeUnpublish a volume
```
$ csc node unpublish --endpoint tcp://127.0.0.1:10000 --target-path /mnt/hostpath CSIVolumeID
$ sudo csc node unpublish --endpoint $endpoint --target-path /mnt/hostpath CSIVolumeID
CSIVolumeID
```

#### Get NodeInfo
```
$ csc node get-info --endpoint tcp://127.0.0.1:10000
$ sudo csc node get-info --endpoint $endpoint
CSINode
```

0 comments on commit 8c36043

Please sign in to comment.