1
1
# Blobfuse CSI driver development guide
2
2
3
3
- Clone repo
4
- ```
4
+ ``` console
5
5
$ mkdir -p $GOPATH /src/sigs.k8s.io
6
6
$ git clone https://github.com/kubernetes-sigs/blobfuse-csi-driver $GOPATH /src/sigs.k8s.io
7
7
```
8
8
9
9
- Build blobfuse driver
10
- ```
10
+ ``` console
11
11
$ cd $GOPATH /src/sigs.k8s.io/blobfuse-csi-driver
12
12
$ make blobfuse
13
13
```
14
14
15
- - Run test
16
- ```
17
- $ make test
15
+ - Run verification before sending PR
16
+ ``` console
17
+ $ make verify
18
18
```
19
19
20
20
- Build continer image and push to dockerhub
21
- ```
21
+ ``` console
22
22
export REGISTRY_NAME=<dockerhub-alias>
23
23
make push-latest
24
24
```
25
25
26
26
### Test locally using csc tool
27
27
Install ` csc ` tool according to https://github.com/rexray/gocsi/tree/master/csc :
28
- ```
28
+ ``` console
29
29
$ mkdir -p $GOPATH /src/github.com
30
30
$ cd $GOPATH /src/github.com
31
31
$ git clone https://github.com/rexray/gocsi.git
@@ -34,7 +34,7 @@ $ make build
34
34
```
35
35
36
36
#### Start CSI driver locally
37
- ```
37
+ ``` console
38
38
$ cd $GOPATH /src/sigs.k8s.io/blobfuse-csi-driver
39
39
$ ./_output/blobfuseplugin --endpoint tcp://127.0.0.1:10000 --nodeid CSINode -v=5 &
40
40
```
@@ -44,54 +44,63 @@ export set AZURE_CREDENTIAL_FILE=/etc/kubernetes/azure.json
44
44
```
45
45
46
46
#### 1. Get plugin info
47
- ```
47
+ ``` console
48
48
$ csc identity plugin-info --endpoint tcp://127.0.0.1:10000
49
49
"blobfuse.csi.azure.com" "v0.4.0"
50
50
```
51
51
52
52
#### 2. Create an blobfuse volume
53
- ```
53
+ ``` console
54
54
$ 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"
56
56
```
57
57
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"
63
62
```
64
63
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"
66
68
```
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"
69
73
```
70
74
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"
72
78
```
79
+
80
+ #### 7. Delete blobfuse volume
81
+ ``` console
73
82
$ csc controller del --endpoint tcp://127.0.0.1:10000 CSIVolumeID
74
83
CSIVolumeID
75
84
```
76
85
77
- #### 6 . Validate volume capabilities
78
- ```
86
+ #### 8 . Validate volume capabilities
87
+ ``` console
79
88
$ csc controller validate-volume-capabilities --endpoint tcp://127.0.0.1:10000 --cap 1,block CSIVolumeID
80
89
CSIVolumeID true
81
90
```
82
91
83
- #### 7 . Get NodeID
84
- ```
92
+ #### 9 . Get NodeID
93
+ ``` console
85
94
$ csc node get-info --endpoint tcp://127.0.0.1:10000
86
95
CSINode
87
96
```
88
97
89
- #### 8 . Create snapshot
90
- ```
98
+ #### 10 . Create snapshot
99
+ ``` console
91
100
$ csc controller create-snapshot
92
101
```
93
102
94
- #### 9 . Delete snapshot
95
- ```
103
+ #### 11 . Delete snapshot
104
+ ``` console
96
105
$ csc controller delete-snapshot
97
106
```
0 commit comments