Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update readme doc #456

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

https://github.com/rexray/gocsi is no longer supported. We should remove this entire section that relies on it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently the csc tool works ok.
If we remove this section, is there any other tool to use?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

csi-sanity can be used, it is part of the csi-test repository.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it, will try the tool and update the doc.
Thanks.

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
```