Skip to content

Commit aa3eb8b

Browse files
authored
Update csi-dev.md
1 parent 1ea336b commit aa3eb8b

File tree

1 file changed

+37
-28
lines changed

1 file changed

+37
-28
lines changed

docs/csi-dev.md

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,31 @@
11
# Blobfuse CSI driver development guide
22

33
- Clone repo
4-
```
4+
```console
55
$ mkdir -p $GOPATH/src/sigs.k8s.io
66
$ git clone https://github.com/kubernetes-sigs/blobfuse-csi-driver $GOPATH/src/sigs.k8s.io
77
```
88

99
- Build blobfuse driver
10-
```
10+
```console
1111
$ cd $GOPATH/src/sigs.k8s.io/blobfuse-csi-driver
1212
$ make blobfuse
1313
```
1414

15-
- Run test
16-
```
17-
$ make test
15+
- Run verification before sending PR
16+
```console
17+
$ make verify
1818
```
1919

2020
- Build continer image and push to dockerhub
21-
```
21+
```console
2222
export REGISTRY_NAME=<dockerhub-alias>
2323
make push-latest
2424
```
2525

2626
### Test locally using csc tool
2727
Install `csc` tool according to https://github.com/rexray/gocsi/tree/master/csc:
28-
```
28+
```console
2929
$ mkdir -p $GOPATH/src/github.com
3030
$ cd $GOPATH/src/github.com
3131
$ git clone https://github.com/rexray/gocsi.git
@@ -34,7 +34,7 @@ $ make build
3434
```
3535

3636
#### Start CSI driver locally
37-
```
37+
```console
3838
$ cd $GOPATH/src/sigs.k8s.io/blobfuse-csi-driver
3939
$ ./_output/blobfuseplugin --endpoint tcp://127.0.0.1:10000 --nodeid CSINode -v=5 &
4040
```
@@ -44,54 +44,63 @@ export set AZURE_CREDENTIAL_FILE=/etc/kubernetes/azure.json
4444
```
4545

4646
#### 1. Get plugin info
47-
```
47+
```console
4848
$ csc identity plugin-info --endpoint tcp://127.0.0.1:10000
4949
"blobfuse.csi.azure.com" "v0.4.0"
5050
```
5151

5252
#### 2. Create an blobfuse volume
53-
```
53+
```console
5454
$ csc controller new --endpoint tcp://127.0.0.1:10000 --cap 1,block CSIVolumeName --req-bytes 2147483648 --params skuname=Standard_LRS
55-
CSIVolumeID 2147483648 "accountname"="f5713de20cde511e8ba4900" "skuname"="Standard_LRS"
55+
"andy-mg1160alpha3#fuse4ef4b1d0c53d41bc88f#csivolumename" 2147483648 "skuname"="Standard_LRS"
5656
```
5757

58-
#### 3. Mount an blobfuse volume to a user specified directory
59-
```
60-
$ mkdir ~/testmount
61-
$ csc node publish --endpoint tcp://127.0.0.1:10000 --cap 1,block --target-path ~/testmount CSIVolumeID
62-
#f5713de20cde511e8ba4900#pvc-file-dynamic-8ff5d05a-f47c-11e8-9c3a-000d3a00df41
58+
#### 3. Stage volume
59+
```console
60+
mkdir /tmp/staging-target-path
61+
csc node stage --endpoint tcp://127.0.0.1:10000 --cap 1,block --staging-target-path /tmp/staging-target-path "andy-mg1160alpha3#fuse4ef4b1d0c53d41bc88f#csivolumename"
6362
```
6463

65-
#### 4. Unmount blobfuse volume
64+
#### 4. Publish volume
65+
```console
66+
mkdir /tmp/target-path
67+
csc node publish --endpoint tcp://127.0.0.1:10000 --cap 1,block --staging-target-path /tmp/staging-target-path --target-path /tmp/target-path "andy-mg1160alpha3#fuse4ef4b1d0c53d41bc88f#csivolumename"
6668
```
67-
$ csc node unpublish --endpoint tcp://127.0.0.1:10000 --target-path ~/testmount CSIVolumeID
68-
CSIVolumeID
69+
70+
#### 5. Unpublish volume
71+
```console
72+
csc node unpublish --endpoint tcp://127.0.0.1:10000 --target-path /tmp/target-path "andy-mg1160alpha3#fuse4ef4b1d0c53d41bc88f#csivolumename"
6973
```
7074

71-
#### 5. Delete blobfuse volume
75+
#### 6. Unstage volume
76+
```console
77+
csc node unstage --endpoint tcp://127.0.0.1:10000 --staging-target-path /tmp/staging-target-path "andy-mg1160alpha3#fuse4ef4b1d0c53d41bc88f#csivolumename"
7278
```
79+
80+
#### 7. Delete blobfuse volume
81+
```console
7382
$ csc controller del --endpoint tcp://127.0.0.1:10000 CSIVolumeID
7483
CSIVolumeID
7584
```
7685

77-
#### 6. Validate volume capabilities
78-
```
86+
#### 8. Validate volume capabilities
87+
```console
7988
$ csc controller validate-volume-capabilities --endpoint tcp://127.0.0.1:10000 --cap 1,block CSIVolumeID
8089
CSIVolumeID true
8190
```
8291

83-
#### 7. Get NodeID
84-
```
92+
#### 9. Get NodeID
93+
```console
8594
$ csc node get-info --endpoint tcp://127.0.0.1:10000
8695
CSINode
8796
```
8897

89-
#### 8. Create snapshot
90-
```
98+
#### 10. Create snapshot
99+
```console
91100
$ csc controller create-snapshot
92101
```
93102

94-
#### 9. Delete snapshot
95-
```
103+
#### 11. Delete snapshot
104+
```console
96105
$ csc controller delete-snapshot
97106
```

0 commit comments

Comments
 (0)