|
2 | 2 | title: Enable Ultra Disk support on Azure Kubernetes Service (AKS)
|
3 | 3 | description: Learn how to enable and configure Ultra Disks in an Azure Kubernetes Service (AKS) cluster
|
4 | 4 | ms.topic: article
|
5 |
| -ms.date: 1/9/2022 |
| 5 | +ms.date: 03/28/2023 |
6 | 6 |
|
7 | 7 | ---
|
8 | 8 |
|
9 | 9 | # Use Azure ultra disks on Azure Kubernetes Service
|
10 | 10 |
|
11 |
| -[Azure ultra disks](../virtual-machines/disks-enable-ultra-ssd.md) offer high throughput, high IOPS, and consistent low latency disk storage for your stateful applications. One major benefit of ultra disks is the ability to dynamically change the performance of the SSD along with your workloads without the need to restart your agent nodes. Ultra disks are suited for data-intensive workloads. |
| 11 | +[Azure ultra disks](../virtual-machines/disks-enable-ultra-ssd.md) offer high throughput, high IOPS, and consistent low latency disk storage for your stateful applications. With ultra disks, you can dynamically change the performance of the SSD along with your workloads without the need to restart your agent nodes. Ultra disks are suited for data-intensive workloads. |
12 | 12 |
|
13 | 13 | ## Before you begin
|
14 | 14 |
|
15 |
| -This feature can only be set at cluster creation or node pool creation time. |
| 15 | +This feature can only be set at cluster or node pool creation time. |
16 | 16 |
|
17 | 17 | > [!IMPORTANT]
|
18 |
| -> Azure ultra disks require nodepools deployed in availability zones and regions that support these disks as well as only specific VM series. See the [**Ultra disks GA scope and limitations**](../virtual-machines/disks-enable-ultra-ssd.md#ga-scope-and-limitations). |
| 18 | +> Azure ultra disks require node pools deployed in availability zones and regions that support these disks and specific VM series. For more information, see the [**Ultra disks GA scope and limitations**](../virtual-machines/disks-enable-ultra-ssd.md#ga-scope-and-limitations). |
19 | 19 |
|
20 | 20 | ### Limitations
|
21 | 21 |
|
22 |
| -- Ultra disks can't be used with some features and functionality, such as availability sets or Azure Disk Encryption. Review [**Ultra disks GA scope and limitations**](../virtual-machines/disks-enable-ultra-ssd.md#ga-scope-and-limitations) before proceeding. |
23 |
| -- The supported size range for ultra disks is between 100 and 1500. |
| 22 | +- Ultra disks can't be used with certain features, such as availability sets or Azure Disk encryption. Review [**Ultra disks GA scope and limitations**](../virtual-machines/disks-enable-ultra-ssd.md#ga-scope-and-limitations) before proceeding. |
| 23 | +- The supported size range for ultra disks is between *100* and *1500*. |
24 | 24 |
|
25 |
| -## Create a new cluster that can use ultra disks |
| 25 | +## Create a cluster that can use ultra disks |
26 | 26 |
|
27 |
| -Create an AKS cluster that is able to leverage Azure ultra Disks by using the following CLI commands. Use the `--enable-ultra-ssd` flag to set the `EnableUltraSSD` feature. |
| 27 | +Create an AKS cluster that can use ultra disks by enabling the `EnableUltraSSD` feature. |
28 | 28 |
|
29 |
| -Create an Azure resource group: |
| 29 | +1. Create an Azure resource group using the [`az group create`][az-group-create] command. |
30 | 30 |
|
31 |
| -```azurecli-interactive |
32 |
| -az group create --name myResourceGroup --location westus2 |
33 |
| -``` |
| 31 | + ```azurecli-interactive |
| 32 | + az group create --name myResourceGroup --location westus2 |
| 33 | + ``` |
34 | 34 |
|
35 |
| -Create an AKS-managed Azure AD cluster with support for ultra disks. |
| 35 | +2. Create an AKS-managed Azure AD cluster with support for ultra disks using the [`az aks create`][az-aks-create] command with the `--enable-ultra-ssd` flag. |
36 | 36 |
|
37 |
| -```azurecli-interactive |
38 |
| -az aks create -g MyResourceGroup -n myAKSCluster -l westus2 --node-vm-size Standard_D2s_v3 --zones 1 2 --node-count 2 --enable-ultra-ssd |
39 |
| -``` |
40 |
| - |
41 |
| -If you want to create clusters without ultra disk support, you can do so by omitting the `--enable-ultra-ssd` parameter. |
| 37 | + ```azurecli-interactive |
| 38 | + az aks create -g MyResourceGroup -n myAKSCluster -l westus2 --node-vm-size Standard_D2s_v3 --zones 1 2 --node-count 2 --enable-ultra-ssd |
| 39 | + ``` |
42 | 40 |
|
43 | 41 | ## Enable ultra disks on an existing cluster
|
44 | 42 |
|
45 |
| -You can enable ultra disks on existing clusters by adding a new node pool to your cluster that support ultra disks. Configure a new node pool to use ultra disks by using the `--enable-ultra-ssd` flag. |
| 43 | +You can enable ultra disks on existing clusters by adding a new node pool to your cluster that support ultra disks. |
46 | 44 |
|
47 |
| -```azurecli |
48 |
| -az aks nodepool add --name ultradisk --cluster-name myAKSCluster --resource-group myResourceGroup --node-vm-size Standard_D2s_v3 --zones 1 2 --node-count 2 --enable-ultra-ssd |
49 |
| -``` |
| 45 | +- Configure a new node pool to use ultra disks using the [`az aks nodepool add`][az-aks-nodepool-add] command with the `--enable-ultra-ssd` flag. |
50 | 46 |
|
51 |
| -If you want to create new node pools without support for ultra disks, you can do so by omitting the `--enable-ultra-ssd` parameter. |
| 47 | + ```azurecli |
| 48 | + az aks nodepool add --name ultradisk --cluster-name myAKSCluster --resource-group myResourceGroup --node-vm-size Standard_D2s_v3 --zones 1 2 --node-count 2 --enable-ultra-ssd |
| 49 | + ``` |
52 | 50 |
|
53 | 51 | ## Use ultra disks dynamically with a storage class
|
54 | 52 |
|
55 |
| -To use ultra disks in our deployments or stateful sets you can use a [storage class for dynamic provisioning][azure-disk-volume]. |
| 53 | +To use ultra disks in your deployments or stateful sets, you can use a [storage class for dynamic provisioning][azure-disk-volume]. |
56 | 54 |
|
57 | 55 | ### Create the storage class
|
58 | 56 |
|
59 |
| -A storage class is used to define how a unit of storage is dynamically created with a persistent volume. For more information on Kubernetes storage classes, see [Kubernetes Storage Classes][kubernetes-storage-classes]. |
| 57 | +A storage class is used to define how a unit of storage is dynamically created with a persistent volume. For more information on Kubernetes storage classes, see [Kubernetes storage classes][kubernetes-storage-classes]. In this case, we'll create a storage class that references ultra disks. |
60 | 58 |
|
61 |
| -In this case, we'll create a storage class that references ultra disks. Create a file named `azure-ultra-disk-sc.yaml`, and copy in the following manifest. |
| 59 | +1. Create a file named `azure-ultra-disk-sc.yaml` and copy in the following manifest: |
62 | 60 |
|
63 |
| -```yaml |
64 |
| -kind: StorageClass |
65 |
| -apiVersion: storage.k8s.io/v1 |
66 |
| -metadata: |
67 |
| - name: ultra-disk-sc |
68 |
| -provisioner: disk.csi.azure.com # replace with "kubernetes.io/azure-disk" if aks version is less than 1.21 |
69 |
| -volumeBindingMode: WaitForFirstConsumer # optional, but recommended if you want to wait until the pod that will use this disk is created |
70 |
| -parameters: |
71 |
| - skuname: UltraSSD_LRS |
72 |
| - kind: managed |
73 |
| - cachingMode: None |
74 |
| - diskIopsReadWrite: "2000" # minimum value: 2 IOPS/GiB |
75 |
| - diskMbpsReadWrite: "320" # minimum value: 0.032/GiB |
76 |
| -``` |
| 61 | + ```yaml |
| 62 | + kind: StorageClass |
| 63 | + apiVersion: storage.k8s.io/v1 |
| 64 | + metadata: |
| 65 | + name: ultra-disk-sc |
| 66 | + provisioner: disk.csi.azure.com # replace with "kubernetes.io/azure-disk" if aks version is less than 1.21 |
| 67 | + volumeBindingMode: WaitForFirstConsumer # optional, but recommended if you want to wait until the pod that will use this disk is created |
| 68 | + parameters: |
| 69 | + skuname: UltraSSD_LRS |
| 70 | + kind: managed |
| 71 | + cachingMode: None |
| 72 | + diskIopsReadWrite: "2000" # minimum value: 2 IOPS/GiB |
| 73 | + diskMbpsReadWrite: "320" # minimum value: 0.032/GiB |
| 74 | + ``` |
77 | 75 |
|
78 |
| -Create the storage class with the [kubectl apply][kubectl-apply] command and specify your *azure-ultra-disk-sc.yaml* file: |
| 76 | +2. Create the storage class using the [`kubectl apply`][kubectl-apply] command and specify your `azure-ultra-disk-sc.yaml` file. |
79 | 77 |
|
80 |
| -```console |
81 |
| -kubectl apply -f azure-ultra-disk-sc.yaml |
82 |
| -``` |
| 78 | + ```console |
| 79 | + kubectl apply -f azure-ultra-disk-sc.yaml |
| 80 | + ``` |
83 | 81 |
|
84 |
| -The output from the command resembles the following example: |
| 82 | + Your output should resemble the following example output: |
85 | 83 |
|
86 |
| -```console |
87 |
| -storageclass.storage.k8s.io/ultra-disk-sc created |
88 |
| -``` |
| 84 | + ```console |
| 85 | + storageclass.storage.k8s.io/ultra-disk-sc created |
| 86 | + ``` |
89 | 87 |
|
90 | 88 | ## Create a persistent volume claim
|
91 | 89 |
|
92 | 90 | A persistent volume claim (PVC) is used to automatically provision storage based on a storage class. In this case, a PVC can use the previously created storage class to create an ultra disk.
|
93 | 91 |
|
94 |
| -Create a file named `azure-ultra-disk-pvc.yaml`, and copy in the following manifest. The claim requests a disk named `ultra-disk` that is *1000 GB* in size with *ReadWriteOnce* access. The *ultra-disk-sc* storage class is specified as the storage class. |
| 92 | +1. Create a file named `azure-ultra-disk-pvc.yaml` and copy in the following manifest: |
| 93 | +
|
| 94 | + ```yaml |
| 95 | + apiVersion: v1 |
| 96 | + kind: PersistentVolumeClaim |
| 97 | + metadata: |
| 98 | + name: ultra-disk |
| 99 | + spec: |
| 100 | + accessModes: |
| 101 | + - ReadWriteOnce |
| 102 | + storageClassName: ultra-disk-sc |
| 103 | + resources: |
| 104 | + requests: |
| 105 | + storage: 1000Gi |
| 106 | + ``` |
95 | 107 |
|
96 |
| -```yaml |
97 |
| -apiVersion: v1 |
98 |
| -kind: PersistentVolumeClaim |
99 |
| -metadata: |
100 |
| - name: ultra-disk |
101 |
| -spec: |
102 |
| - accessModes: |
103 |
| - - ReadWriteOnce |
104 |
| - storageClassName: ultra-disk-sc |
105 |
| - resources: |
106 |
| - requests: |
107 |
| - storage: 1000Gi |
108 |
| -``` |
| 108 | + The claim requests a disk named `ultra-disk` that is *1000 GB* in size with *ReadWriteOnce* access. The *ultra-disk-sc* storage class is specified as the storage class. |
109 | 109 |
|
110 |
| -Create the persistent volume claim with the [kubectl apply][kubectl-apply] command and specify your *azure-ultra-disk-pvc.yaml* file: |
| 110 | +2. Create the persistent volume claim using the [`kubectl apply`][kubectl-apply] command and specify your `azure-ultra-disk-pvc.yaml` file. |
111 | 111 |
|
112 |
| -```console |
113 |
| -kubectl apply -f azure-ultra-disk-pvc.yaml |
114 |
| -``` |
| 112 | + ```console |
| 113 | + kubectl apply -f azure-ultra-disk-pvc.yaml |
| 114 | + ``` |
115 | 115 |
|
116 |
| -The output from the command resembles the following example: |
| 116 | + Your output should resemble the following example output: |
117 | 117 |
|
118 |
| -```console |
119 |
| -persistentvolumeclaim/ultra-disk created |
120 |
| -``` |
| 118 | + ```console |
| 119 | + persistentvolumeclaim/ultra-disk created |
| 120 | + ``` |
121 | 121 |
|
122 | 122 | ## Use the persistent volume
|
123 | 123 |
|
124 | 124 | Once the persistent volume claim has been created and the disk successfully provisioned, a pod can be created with access to the disk. The following manifest creates a basic NGINX pod that uses the persistent volume claim named *ultra-disk* to mount the Azure disk at the path `/mnt/azure`.
|
125 | 125 |
|
126 |
| -Create a file named `nginx-ultra.yaml`, and copy in the following manifest. |
127 |
| - |
128 |
| -```yaml |
129 |
| -kind: Pod |
130 |
| -apiVersion: v1 |
131 |
| -metadata: |
132 |
| - name: nginx-ultra |
133 |
| -spec: |
134 |
| - containers: |
135 |
| - - name: nginx-ultra |
136 |
| - image: mcr.microsoft.com/oss/nginx/nginx:1.15.5-alpine |
137 |
| - resources: |
138 |
| - requests: |
139 |
| - cpu: 100m |
140 |
| - memory: 128Mi |
141 |
| - limits: |
142 |
| - cpu: 250m |
143 |
| - memory: 256Mi |
144 |
| - volumeMounts: |
145 |
| - - mountPath: "/mnt/azure" |
146 |
| - name: volume |
147 |
| - volumes: |
148 |
| - - name: volume |
149 |
| - persistentVolumeClaim: |
150 |
| - claimName: ultra-disk |
151 |
| -``` |
152 |
| -
|
153 |
| -Create the pod with the [kubectl apply][kubectl-apply] command, as shown in the following example: |
154 |
| -
|
155 |
| -```console |
156 |
| -kubectl apply -f nginx-ultra.yaml |
157 |
| -``` |
158 |
| - |
159 |
| -The output from the command resembles the following example: |
160 |
| - |
161 |
| -```console |
162 |
| -pod/nginx-ultra created |
163 |
| -``` |
164 |
| - |
165 |
| -You now have a running pod with your Azure disk mounted in the `/mnt/azure` directory. This configuration can be seen when inspecting your pod via `kubectl describe pod nginx-ultra`, as shown in the following condensed example: |
166 |
| - |
167 |
| -```console |
168 |
| -kubectl describe pod nginx-ultra |
169 |
| - |
170 |
| -[...] |
171 |
| -Volumes: |
172 |
| - volume: |
173 |
| - Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace) |
174 |
| - ClaimName: azure-managed-disk |
175 |
| - ReadOnly: false |
176 |
| - default-token-smm2n: |
177 |
| - Type: Secret (a volume populated by a Secret) |
178 |
| - SecretName: default-token-smm2n |
179 |
| - Optional: false |
180 |
| -[...] |
181 |
| -Events: |
182 |
| - Type Reason Age From Message |
183 |
| - ---- ------ ---- ---- ------- |
184 |
| - Normal Scheduled 2m default-scheduler Successfully assigned mypod to aks-nodepool1-79590246-0 |
185 |
| - Normal SuccessfulMountVolume 2m kubelet, aks-nodepool1-79590246-0 MountVolume.SetUp succeeded for volume "default-token-smm2n" |
186 |
| - Normal SuccessfulMountVolume 1m kubelet, aks-nodepool1-79590246-0 MountVolume.SetUp succeeded for volume "pvc-faf0f176-8b8d-11e8-923b-deb28c58d242" |
187 |
| -[...] |
188 |
| -``` |
| 126 | +1. Create a file named `nginx-ultra.yaml` and copy in the following manifest: |
| 127 | +
|
| 128 | + ```yaml |
| 129 | + kind: Pod |
| 130 | + apiVersion: v1 |
| 131 | + metadata: |
| 132 | + name: nginx-ultra |
| 133 | + spec: |
| 134 | + containers: |
| 135 | + - name: nginx-ultra |
| 136 | + image: mcr.microsoft.com/oss/nginx/nginx:1.15.5-alpine |
| 137 | + resources: |
| 138 | + requests: |
| 139 | + cpu: 100m |
| 140 | + memory: 128Mi |
| 141 | + limits: |
| 142 | + cpu: 250m |
| 143 | + memory: 256Mi |
| 144 | + volumeMounts: |
| 145 | + - mountPath: "/mnt/azure" |
| 146 | + name: volume |
| 147 | + volumes: |
| 148 | + - name: volume |
| 149 | + persistentVolumeClaim: |
| 150 | + claimName: ultra-disk |
| 151 | + ``` |
| 152 | +
|
| 153 | +2. Create the pod using [`kubectl apply`][kubectl-apply] command and specify your `nginx-ultra.yaml` file. |
| 154 | +
|
| 155 | + ```console |
| 156 | + kubectl apply -f nginx-ultra.yaml |
| 157 | + ``` |
| 158 | +
|
| 159 | + Your output should resemble the following example output: |
| 160 | +
|
| 161 | + ```console |
| 162 | + pod/nginx-ultra created |
| 163 | + ``` |
| 164 | +
|
| 165 | + You now have a running pod with your Azure disk mounted in the `/mnt/azure` directory. |
| 166 | +
|
| 167 | +3. See your configuration details using the `kubectl describe pod` command and specify your `nginx-ultra.yaml` file. |
| 168 | +
|
| 169 | + ```console |
| 170 | + kubectl describe pod nginx-ultra |
| 171 | + ``` |
| 172 | +
|
| 173 | + Your output should resemble the following example output: |
| 174 | +
|
| 175 | + ```console |
| 176 | + [...] |
| 177 | + Volumes: |
| 178 | + volume: |
| 179 | + Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace) |
| 180 | + ClaimName: azure-managed-disk |
| 181 | + ReadOnly: false |
| 182 | + default-token-smm2n: |
| 183 | + Type: Secret (a volume populated by a Secret) |
| 184 | + SecretName: default-token-smm2n |
| 185 | + Optional: false |
| 186 | + [...] |
| 187 | + Events: |
| 188 | + Type Reason Age From Message |
| 189 | + ---- ------ ---- ---- ------- |
| 190 | + Normal Scheduled 2m default-scheduler Successfully assigned mypod to aks-nodepool1-79590246-0 |
| 191 | + Normal SuccessfulMountVolume 2m kubelet, aks-nodepool1-79590246-0 MountVolume.SetUp succeeded for volume "default-token-smm2n" |
| 192 | + Normal SuccessfulMountVolume 1m kubelet, aks-nodepool1-79590246-0 MountVolume.SetUp succeeded for volume "pvc-faf0f176-8b8d-11e8-923b-deb28c58d242" |
| 193 | + [...] |
| 194 | + ``` |
189 | 195 |
|
190 | 196 | ## Using Azure tags
|
191 | 197 |
|
192 |
| -For more details on using Azure tags, see [Use Azure tags in Azure Kubernetes Service (AKS)][use-tags]. |
| 198 | +For more details on using Azure tags, see [Use Azure tags in AKS][use-tags]. |
193 | 199 |
|
194 | 200 | ## Next steps
|
195 | 201 |
|
196 | 202 | - For more about ultra disks, see [Using Azure ultra disks](../virtual-machines/disks-enable-ultra-ssd.md).
|
197 |
| -- For more about storage best practices, see [Best practices for storage and backups in Azure Kubernetes Service (AKS)][operator-best-practices-storage] |
| 203 | +- For more about storage best practices, see [Best practices for storage and backups in AKS][operator-best-practices-storage]. |
198 | 204 |
|
199 | 205 | <!-- LINKS - external -->
|
200 |
| -[access-modes]: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes |
201 | 206 | [kubectl-apply]: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply
|
202 |
| -[kubectl-get]: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#get |
203 | 207 | [kubernetes-storage-classes]: https://kubernetes.io/docs/concepts/storage/storage-classes/
|
204 |
| -[kubernetes-volumes]: https://kubernetes.io/docs/concepts/storage/persistent-volumes/ |
205 |
| -[managed-disk-pricing-performance]: https://azure.microsoft.com/pricing/details/managed-disks/ |
206 | 208 |
|
207 | 209 | <!-- LINKS - internal -->
|
208 | 210 | [azure-disk-volume]: azure-disk-csi.md
|
209 |
| -[azure-files-pvc]: azure-files-csi.md |
210 |
| -[premium-storage]: ../virtual-machines/disks-types.md |
211 |
| -[az-disk-list]: /cli/azure/disk#az_disk_list |
212 |
| -[az-snapshot-create]: /cli/azure/snapshot#az_snapshot_create |
213 |
| -[az-disk-create]: /cli/azure/disk#az_disk_create |
214 |
| -[az-disk-show]: /cli/azure/disk#az_disk_show |
215 |
| -[aks-quickstart-cli]: kubernetes-walkthrough.md |
216 |
| -[aks-quickstart-portal]: kubernetes-walkthrough-portal.md |
217 |
| -[install-azure-cli]: /cli/azure/install-azure-cli |
218 | 211 | [operator-best-practices-storage]: operator-best-practices-storage.md
|
219 |
| -[concepts-storage]: concepts-storage.md |
220 |
| -[storage-class-concepts]: concepts-storage.md#storage-classes |
221 |
| -[az-extension-add]: /cli/azure/extension#az_extension_add |
222 |
| -[az-extension-update]: /cli/azure/extension#az_extension_update |
223 |
| -[az-feature-register]: /cli/azure/feature#az_feature_register |
224 |
| -[az-feature-list]: /cli/azure/feature#az_feature_list |
225 |
| -[az-provider-register]: /cli/azure/provider#az_provider_register |
226 | 212 | [use-tags]: use-tags.md
|
| 213 | +[az-group-create]: /cli/azure/group#az_group_create |
| 214 | +[az-aks-create]: /cli/azure/aks#az_aks_create |
| 215 | +[az-aks-nodepool-add]: /cli/azure/aks/nodepool#az_aks_nodepool_add |
0 commit comments