You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow these steps to create and attach a persistent volume.
39
+
40
+
### 1. Create a storage pool
37
41
38
42
First, create a storage pool, which is a logical grouping of storage for your Kubernetes cluster, by defining it in a YAML manifest file.
39
43
40
-
If you enabled Azure Container Storage using `az aks create` or `az aks update` commands, you might already have a storage pool. Use `kubectl get sp -n acstor` to get the list of storage pools. If you have a storage pool already available that you want to use, you can skip this section and proceed to [Display the available storage classes](#display-the-available-storage-classes).
44
+
If you enabled Azure Container Storage using `az aks create` or `az aks update` commands, you might already have a storage pool. Use `kubectl get sp -n acstor` to get the list of storage pools. If you have a storage pool already available that you want to use, you can skip this section and proceed to [Display the available storage classes](#2-display-the-available-storage-classes).
41
45
42
46
Follow these steps to create a storage pool with Azure Elastic SAN.
43
47
@@ -78,7 +82,7 @@ Follow these steps to create a storage pool with Azure Elastic SAN.
78
82
79
83
When the storage pool is created, Azure Container Storage will create a storage class on your behalf using the naming convention `acstor-<storage-pool-name>`. It will also create an Azure Elastic SAN resource.
80
84
81
-
## Display the available storage classes
85
+
### 2. Display the available storage classes
82
86
83
87
When the storage pool is ready to use, you must select a storage class to define how storage is dynamically created when creating persistent volume claims and deploying persistent volumes.
84
88
@@ -87,9 +91,9 @@ Run `kubectl get sc` to display the available storage classes. You should see a
87
91
> [!IMPORTANT]
88
92
> Don't use the storage class that's marked **internal**. It's an internal storage class that's needed for Azure Container Storage to work.
89
93
90
-
## Create a persistent volume claim
94
+
### 3. Create a persistent volume claim
91
95
92
-
A persistent volume claim (PVC) is used to automatically provision storage based on a storage class. Follow these steps to create a PVC using the new storage class.
96
+
A persistent volume claim (PVC) is used to automatically provision storage based on a storage class. Follow these steps to create a PVC using the new storage class.
93
97
94
98
1. Use your favorite text editor to create a YAML manifest file such as `code acstor-pvc.yaml`.
95
99
@@ -129,7 +133,7 @@ A persistent volume claim (PVC) is used to automatically provision storage based
129
133
130
134
Once the PVC is created, it's ready for use by a pod.
131
135
132
-
## Deploy a pod and attach a persistent volume
136
+
### 4. Deploy a pod and attach a persistent volume
133
137
134
138
Create a pod using [Fio](https://github.com/axboe/fio) (Flexible I/O Tester) for benchmarking and workload simulation, and specify a mount path for the persistent volume. For **claimName**, use the **name** value that you used when creating the persistent volume claim.
135
139
@@ -187,19 +191,23 @@ Create a pod using [Fio](https://github.com/axboe/fio) (Flexible I/O Tester) for
187
191
188
192
You've now deployed a pod that's using an Elastic SAN as its storage, and you can use it for your Kubernetes workloads.
189
193
190
-
## Detach and reattach a persistent volume
194
+
## Manage persistent volumes and storage pools
195
+
196
+
Now that you've created a persistent volume, you can detach and reattach it as needed. You can also delete a storage pool.
197
+
198
+
### Detach and reattach a persistent volume
191
199
192
200
To detach a persistent volume, delete the pod that the persistent volume is attached to. Replace `<pod-name>` with the name of the pod, for example **fiopod**.
193
201
194
202
```azurecli-interactive
195
203
kubectl delete pods <pod-name>
196
204
```
197
205
198
-
To reattach a persistent volume, simply reference the persistent volume claim name in the YAML manifest file as described in [Deploy a pod and attach a persistent volume](#deploy-a-pod-and-attach-a-persistent-volume).
206
+
To reattach a persistent volume, simply reference the persistent volume claim name in the YAML manifest file as described in [Deploy a pod and attach a persistent volume](#4-deploy-a-pod-and-attach-a-persistent-volume).
199
207
200
208
To check which persistent volume a persistent volume claim is bound to, run `kubectl get pvc <persistent-volume-claim-name>`.
201
209
202
-
## Delete a storage pool
210
+
###Delete a storage pool
203
211
204
212
If you want to delete a storage pool, run the following command. Replace `<storage-pool-name>` with the storage pool name.
0 commit comments