|
2 | 2 | #### 1. create a pod with csi azurefile driver mount on linux
|
3 | 3 | ##### Option#1: Azurefile Dynamic Provisioning
|
4 | 4 | - Create an azurefile CSI storage class
|
5 |
| -``` |
| 5 | +```console |
6 | 6 | kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/storageclass-azurefile-csi.yaml
|
7 | 7 | ```
|
8 | 8 |
|
9 | 9 | - Create an azurefile CSI PVC
|
10 |
| -``` |
| 10 | +```console |
11 | 11 | kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/pvc-azurefile-csi.yaml
|
12 | 12 | ```
|
13 | 13 |
|
14 | 14 | ##### Option#2: Azurefile Static Provisioning(use an existing azure file share)
|
15 | 15 | - Use `kubectl create secret` to create `azure-secret` with existing storage account name and key
|
16 |
| -``` |
| 16 | +```console |
17 | 17 | kubectl create secret generic azure-secret --from-literal accountname=NAME --from-literal accountkey="KEY" --type=Opaque
|
18 | 18 | ```
|
19 | 19 |
|
20 | 20 | - Create an azurefile CSI PV, download `pv-azurefile-csi.yaml` file and edit `shareName` in `volumeAttributes`
|
21 |
| -``` |
| 21 | +```console |
22 | 22 | wget https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/pv-azurefile-csi.yaml
|
23 | 23 | vi pv-azurefile-csi.yaml
|
24 | 24 | kubectl create -f pv-azurefile-csi.yaml
|
25 | 25 | ```
|
26 | 26 |
|
27 | 27 | - Create an azurefile CSI PVC which would be bound to the above PV
|
28 |
| -``` |
| 28 | +```console |
29 | 29 | kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/pvc-azurefile-csi-static.yaml
|
30 | 30 | ```
|
31 | 31 |
|
32 | 32 | #### 2. validate PVC status and create an nginx pod
|
33 | 33 | - make sure pvc is created and in `Bound` status finally
|
34 |
| -``` |
| 34 | +```console |
35 | 35 | watch kubectl describe pvc pvc-azurefile
|
36 | 36 | ```
|
37 | 37 |
|
38 | 38 | - create a pod with azurefile CSI PVC
|
39 |
| -``` |
| 39 | +```console |
40 | 40 | kubectl create -f https://raw.githubusercontent.com/kubernetes-sigs/azurefile-csi-driver/master/deploy/example/nginx-pod-azurefile.yaml
|
41 | 41 | ```
|
42 | 42 |
|
43 | 43 | #### 3. enter the pod container to do validation
|
44 | 44 | - watch the status of pod until its Status changed from `Pending` to `Running` and then enter the pod container
|
45 |
| -``` |
| 45 | +```console |
46 | 46 | $ watch kubectl describe po nginx-azurefile
|
47 | 47 | $ kubectl exec -it nginx-azurefile -- bash
|
48 | 48 | root@nginx-azurefile:/# df -h
|
|
0 commit comments