2
2
create a pod with blobfuse mount on linux
3
3
### Dynamic Provisioning (create storage account and container automatically by blobfuse driver)
4
4
- Create a blobfuse CSI storage class
5
- ``` sh
5
+ ``` console
6
6
kubectl create -f https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/storageclass-blobfuse-csi-mountoptions.yaml
7
7
```
8
8
9
9
- Create a blobfuse CSI PVC
10
- ``` sh
10
+ ``` console
11
11
kubectl create -f https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/pvc-blobfuse-csi.yaml
12
12
```
13
13
14
14
### Static Provisioning(use an existing storage account)
15
15
#### Option #1 : use existing credentials in k8s cluster
16
16
> make sure the existing credentials in k8s cluster(e.g. service principal, msi) could access the specified storage account
17
17
- Download a blobfuse CSI storage class, edit ` resourceGroup ` , ` storageAccount ` , ` containerName ` in storage class
18
- ``` sh
18
+ ``` console
19
19
wget https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/storageclass-blobfuse-csi-existing-container.yaml
20
20
vi storageclass-blobfuse-csi-existing-container.yaml
21
21
kubectl create -f storageclass-blobfuse-csi-existing-container.yaml
22
22
```
23
23
24
24
- Create a blobfuse CSI PVC
25
- ``` sh
25
+ ``` console
26
26
kubectl create -f https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/pvc-blobfuse-csi.yaml
27
27
```
28
28
29
29
#### Option #2 : provide storage account name and key(or sastoken)
30
30
- Use ` kubectl create secret ` to create ` azure-secret ` with existing storage account name and key(or sastoken)
31
- ```
31
+ ``` console
32
32
kubectl create secret generic azure-secret --from-literal azurestorageaccountname=NAME --from-literal azurestorageaccountkey="KEY" --type=Opaque
33
33
#kubectl create secret generic azure-secret --from-literal azurestorageaccountname=NAME --from-literal azurestorageaccountsastoken
34
34
="sastoken" --type=Opaque
@@ -37,31 +37,31 @@ kubectl create secret generic azure-secret --from-literal azurestorageaccountnam
37
37
> storage account key(or sastoken) could also be stored in Azure Key Vault, check example here: [ read-from-keyvault] ( ./docs/read-from-keyvault.md )
38
38
39
39
- Create a blobfuse CSI PV, download ` pv-blobfuse-csi.yaml ` file and edit ` containerName ` in ` volumeAttributes `
40
- ``` sh
40
+ ``` console
41
41
wget https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/pv-blobfuse-csi.yaml
42
42
vi pv-blobfuse-csi.yaml
43
43
kubectl create -f pv-blobfuse-csi.yaml
44
44
```
45
45
46
46
- Create a blobfuse CSI PVC which would be bound to the above PV
47
- ```
47
+ ``` console
48
48
kubectl create -f https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/pvc-blobfuse-csi-static.yaml
49
49
```
50
50
51
51
#### 2. Validate PVC status and create an nginx pod
52
52
> make sure pvc is created and in ` Bound ` status
53
- ```
53
+ ``` console
54
54
watch kubectl describe pvc pvc-blobfuse
55
55
```
56
56
57
57
- create a pod with blobfuse CSI PVC
58
- ```
58
+ ``` console
59
59
kubectl create -f https://raw.githubusercontent.com/csi-driver/blobfuse-csi-driver/master/deploy/example/nginx-pod-blobfuse.yaml
60
60
```
61
61
62
62
#### 3. enter the pod container to do validation
63
63
- watch the status of pod until its Status changed from ` Pending ` to ` Running ` and then enter the pod container
64
- ``` sh
64
+ ``` console
65
65
$ watch kubectl describe po nginx-blobfuse
66
66
$ kubectl exec -it nginx-blobfuse -- bash
67
67
Filesystem Size Used Avail Use% Mounted on
0 commit comments