Skip to content

Commit 6eeeee5

Browse files
authored
Update e2e_usage.md
1 parent 33d7c65 commit 6eeeee5

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

deploy/example/e2e_usage.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
## CSI driver example
22

3-
### Dynamic Provisioning (create storage account and container by Blob Storage CSI driver)
4-
- Create a blob storage CSI storage class
3+
### Dynamic Provisioning (create storage account and blob container by CSI driver)
4+
- Create CSI storage class
55
```console
66
kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/example/storageclass-blobfuse.yaml
77
```
88

99
- Create a statefulset with blob storage mount
1010
```console
1111
kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/example/statefulset.yaml
12+
```
13+
14+
- Execute `df -h` command in the container
15+
```
16+
# kubectl exec -it statefulset-blob-0 sh
17+
# df -h
18+
Filesystem Size Used Avail Use% Mounted on
19+
...
20+
blobfuse 14G 41M 13G 1% /mnt/blob
21+
...
1222
```
1323

1424
### Static Provisioning(use an existing storage account)
15-
#### Option#1: use existing credentials in k8s cluster
16-
> Make sure the existing credentials in k8s cluster(e.g. service principal, msi) could access the specified storage account
25+
#### Option#1: Use storage class
26+
> make sure cluster identity could access storage account
1727
- Download [blob storage CSI storage class](https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/example/storageclass-blobfuse-existing-container.yaml), edit `resourceGroup`, `storageAccount`, `containerName` in storage class
1828
```yaml
1929
apiVersion: storage.k8s.io/v1
@@ -29,16 +39,13 @@ reclaimPolicy: Retain # If set as "Delete" container would be removed after pvc
2939
volumeBindingMode: Immediate
3040
```
3141
42+
- Create storage class and PVC
3243
```console
3344
kubectl create -f storageclass-blobfuse-existing-container.yaml
34-
```
35-
36-
- Create a blob storage CSI PVC
37-
```console
3845
kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/example/pvc-blob-csi.yaml
3946
```
4047

41-
#### Option#2: provide storage account name and key(or sastoken)
48+
#### Option#2: Use secret
4249
- Use `kubectl create secret` to create `azure-secret` with existing storage account name and key(or sastoken)
4350
```console
4451
kubectl create secret generic azure-secret --from-literal azurestorageaccountname=NAME --from-literal azurestorageaccountkey="KEY" --type=Opaque
@@ -69,36 +76,30 @@ spec:
6976
nodeStageSecretRef:
7077
name: azure-secret
7178
namespace: default
72-
```
73-
```console
74-
kubectl create -f pv-blobfuse-csi.yaml
7579
```
7680
77-
- Create a blob storage CSI PVC which would be bound to the above PV
81+
- Create PV and PVC
7882
```console
83+
kubectl create -f pv-blobfuse-csi.yaml
7984
kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/example/pvc-blob-csi-static.yaml
8085
```
8186

82-
#### Validate PVC status and create an nginx pod
83-
> make sure pvc is created and in `Bound` status
87+
- make sure pvc is created and in `Bound` status after a while
8488
```console
85-
watch kubectl describe pvc pvc-blob
89+
kubectl describe pvc pvc-blob
8690
```
8791

88-
- create a pod with blob storage CSI PVC
92+
#### create a pod with PVC mount
8993
```console
9094
kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/blob-csi-driver/master/deploy/example/nginx-pod-blob.yaml
9195
```
9296

93-
#### Enter container to verify
94-
- watch the status of pod until its Status changed from `Pending` to `Running` and then enter the pod container
97+
- Execute `df -h` command in the container
9598
```console
96-
$ watch kubectl describe po nginx-blob
9799
$ kubectl exec -it nginx-blob -- bash
98100
Filesystem Size Used Avail Use% Mounted on
99101
...
100102
blobfuse 14G 41M 13G 1% /mnt/blob
101-
/dev/sda1 30G 8.9G 21G 31% /etc/hosts
102103
...
103104
```
104105
In the above example, there is a `/mnt/blob` directory mounted as `blobfuse` filesystem.

0 commit comments

Comments
 (0)