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
Copy file name to clipboardExpand all lines: articles/aks/azure-csi-disk-storage-provision.md
+3-117Lines changed: 3 additions & 117 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ titleSuffix: Azure Kubernetes Service
4
4
description: Learn how to create a static or dynamic persistent volume with Azure Disks for use with multiple concurrent pods in Azure Kubernetes Service (AKS)
5
5
ms.topic: article
6
6
ms.custom: devx-track-azurecli
7
-
ms.date: 03/23/2023
7
+
ms.date: 04/11/2023
8
8
---
9
9
10
10
# Create and use a volume with Azure Disks in Azure Kubernetes Service (AKS)
@@ -25,7 +25,7 @@ For more information on Kubernetes volumes, see [Storage options for application
25
25
26
26
* You need an Azure [storage account][azure-storage-account].
27
27
* Make sure you have Azure CLI version 2.0.59 or later installed and configured. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI][install-azure-cli].
28
-
* The Azure Disks CSI driver has a limit of 32 volumes pernode. The volume count changes based on the size of the node/node pool. Run the [kubectl get][kubectl-get] command to determine the number of volumes that can be allocated per node:
28
+
* The Azure Disk CSI driver has a per-node volume limit. The volume count changes based on the size of the node/node pool. Run the [kubectl get][kubectl-get] command to determine the number of volumes that can be allocated per node:
29
29
30
30
```console
31
31
kubectl get CSINode <nodename> -o yaml
@@ -42,7 +42,6 @@ This section provides guidance for cluster administrators who want to provision
42
42
|skuName | Azure Disks storage account type (alias: `storageAccountType`)| `Standard_LRS`, `Premium_LRS`, `StandardSSD_LRS`, `PremiumV2_LRS`, `UltraSSD_LRS`, `Premium_ZRS`, `StandardSSD_ZRS` | No | `StandardSSD_LRS`|
43
43
|fsType | File System Type | `ext4`, `ext3`, `ext2`, `xfs`, `btrfs` for Linux, `ntfs` for Windows | No | `ext4` for Linux, `ntfs` for Windows|
44
44
|cachingMode | [Azure Data Disk Host Cache Setting][disk-host-cache-setting] | `None`, `ReadOnly`, `ReadWrite` | No | `ReadOnly`|
45
-
|location | Specify Azure region where Azure Disks will be created | `eastus`, `westus`, etc. | No | If empty, driver will use the same location name as current AKS cluster|
46
45
|resourceGroup | Specify the resource group where the Azure Disks will be created | Existing resource group name | No | If empty, driver will use the same resource group name as current AKS cluster|
@@ -55,10 +54,8 @@ This section provides guidance for cluster administrators who want to provision
55
54
|diskAccessID | Azure Resource ID of the DiskAccess resource to use private endpoints on disks | | No | ``|
56
55
|enableBursting | [Enable on-demand bursting][on-demand-bursting] beyond the provisioned performance target of the disk. On-demand bursting should only be applied to Premium disk and when the disk size > 512 GB. Ultra and shared disk isn't supported. Bursting is disabled by default. | `true`, `false` | No | `false`|
57
56
|useragent | User agent used for [customer usage attribution][customer-usage-attribution] | | No | Generated Useragent formatted `driverName/driverVersion compiler/version (OS-ARCH)`|
58
-
|enableAsyncAttach | Allow multiple disk attach operations (in batch) on one node in parallel.<br> While this parameter can speed up disk attachment, you may encounter Azure API throttling limit when there are large number of volume attachments. | `true`, `false` | No | `false`|
59
57
|subscriptionID | Specify Azure subscription ID where the Azure Disks is created. | Azure subscription ID | No | If not empty, `resourceGroup` must be provided.|
60
58
|--- | **Following parameters are only for v2** | --- | --- | --- |
61
-
| enableAsyncAttach | The v2 driver uses a different strategy to manage Azure API throttling and ignores this parameter. | | No | |
62
59
| maxShares | The total number of shared disk mounts allowed for the disk. Setting the value to 2 or more enables attachment replicas. | Supported values depend on the disk size. See [Share an Azure managed disk][share-azure-managed-disk] for supported values. | No | 1 |
63
60
| maxMountReplicaCount | The number of replicas attachments to maintain. | This value must be in the range `[0..(maxShares - 1)]` | No | If `accessMode` is `ReadWriteMany`, the default is `0`. Otherwise, the default is `maxShares - 1` |
64
61
@@ -71,7 +68,7 @@ Each AKS cluster includes four pre-created storage classes, two of them configur
71
68
1. The *default* storage class provisions a standard SSD Azure Disk.
72
69
* Standard storage is backed by Standard SSDs and delivers cost-effective storage while still delivering reliable performance.
73
70
1. The *managed-csi-premium* storage class provisions a premium Azure Disk.
74
-
* Premium disks are backed by SSD-based high-performance, low-latency disks. They're ideal for VMs running production workloads. When you use the Azure Disks CSI driver on AKS, you can also use the `managed-csi` storage class, which is backed by Standard SSD locally redundant storage (LRS).
71
+
* Premium disks are backed by SSD-based high-performance, low-latency disks. They're ideal for VMs running production workloads. When you use the Azure Disk CSI driver on AKS, you can also use the `managed-csi` storage class, which is backed by Standard SSD locally redundant storage (LRS).
75
72
76
73
It's not supported to reduce the size of a PVC (to prevent data loss). You can edit an existing storage class using the `kubectl edit sc` command, or you can create your own custom storage class. For example, if you want to use a disk of size 4 TiB, you must create a storage class that defines `cachingmode: None` because [disk caching isn't supported for disks 4 TiB and larger][disk-host-cache-setting]. For more information about storage classes and creating your own storage class, see [Storage options for applications in AKS][storage-class-concepts].
77
74
@@ -203,117 +200,6 @@ Once the persistent volume claim has been created and the disk successfully prov
203
200
204
201
To use Azure ultra disk, see [Use ultra disks on Azure Kubernetes Service (AKS)][use-ultra-disks].
205
202
206
-
### Back up a persistent volume
207
-
208
-
To back up the data in your persistent volume, take a snapshot of the managed disk for the volume. You can then use this snapshot to create a restored disk and attach to pods as a means of restoring the data.
209
-
210
-
1. Get the volume name with the [kubectl get][kubectl-get] command, such as for the PVC named *azure-managed-disk*:
211
-
212
-
```bash
213
-
kubectl get pvc azure-managed-disk
214
-
```
215
-
216
-
The output of the command resembles the following example:
217
-
218
-
```console
219
-
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
2. This volume name forms the underlying Azure disk name. Query for the disk ID with [az disk list][az-disk-list] and provide your PVC volume name, as shown in the following example:
224
-
225
-
```azurecli
226
-
az disk list --query '[].id | [?contains(@,`pvc-faf0f176-8b8d-11e8-923b-deb28c58d242`)]' -o tsv
3. Use the disk ID to create a snapshot disk with [az snapshot create][az-snapshot-create]. The following example creates a snapshot named *pvcSnapshot* in the same resource group as the AKS cluster *MC_myResourceGroup_myAKSCluster_eastus*. You may encounter permission issues if you create snapshots and restore disks in resource groups that the AKS cluster doesn't have access to. Depending on the amount of data on your disk, it may take a few minutes to create the snapshot.
1. To restore the disk and use it with a Kubernetes pod, use the snapshot as a source when you create a disk with [az disk create][az-disk-create]. This operation preserves the original resource if you then need to access the original data snapshot. The following example creates a disk named *pvcRestored* from the snapshot named *pvcSnapshot*:
243
-
244
-
```azurecli
245
-
az disk create --resource-group MC_myResourceGroup_myAKSCluster_eastus --name pvcRestored --source pvcSnapshot
246
-
```
247
-
248
-
2. To use the restored disk with a pod, specify the ID of the disk in the manifest. Get the disk ID with the [az disk show][az-disk-show] command. The following example gets the disk ID for *pvcRestored* created in the previous step:
249
-
250
-
```azurecli
251
-
az disk show --resource-group MC_myResourceGroup_myAKSCluster_eastus --name pvcRestored --query id -o tsv
252
-
```
253
-
254
-
3. Create a pod manifest named `azure-restored.yaml` and specify the disk URI obtained in the previous step. The following example creates a basic NGINX web server, with the restored disk mounted as a volume at */mnt/azure*:
4. Create the pod with the [kubectl apply][kubectl-apply] command, as shown in the following example:
284
-
285
-
```bash
286
-
kubectl apply -f azure-restored.yaml
287
-
```
288
-
289
-
The output of the command resembles the following example:
290
-
291
-
```console
292
-
pod/mypodrestored created
293
-
```
294
-
295
-
5. You can use `kubectl describe pod mypodrestored` to view details of the pod, such as the following condensed example that shows the volume information:
296
-
297
-
```bash
298
-
kubectl describe pod mypodrestored
299
-
```
300
-
301
-
The output of the command resembles the following example:
302
-
303
-
```console
304
-
[...]
305
-
Volumes:
306
-
volume:
307
-
Type: AzureDisk (an Azure Data Disk mount on the host and bind mount to the pod)
0 commit comments