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/concepts-storage.md
+45-47Lines changed: 45 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,10 +2,9 @@
2
2
title: Concepts - Storage in Azure Kubernetes Services (AKS)
3
3
description: Learn about storage in Azure Kubernetes Service (AKS), including volumes, persistent volumes, storage classes, and claims.
4
4
ms.topic: conceptual
5
-
ms.date: 03/19/2024
5
+
ms.date: 05/02/2024
6
6
author: tamram
7
7
ms.author: tamram
8
-
9
8
ms.subservice: aks-storage
10
9
---
11
10
@@ -31,7 +30,7 @@ This article introduces the core concepts that provide storage to your applicati
31
30
32
31
## Ephemeral OS disk
33
32
34
-
By default, Azure automatically replicates the operating system disk for a virtual machine to Azure storage to avoid data loss when the VM is relocated to another host. However, since containers aren't designed to have local state persisted, this behavior offers limited value while providing some drawbacks. These drawbacks include, but aren't limited to, slower node provisioning and higher read/write latency.
33
+
By default, Azure automatically replicates the operating system disk for a virtual machine to Azure Storage to avoid data loss when the VM is relocated to another host. However, since containers aren't designed to have local state persisted, this behavior offers limited value while providing some drawbacks. These drawbacks include, but aren't limited to, slower node provisioning and higher read/write latency.
35
34
36
35
By contrast, ephemeral OS disks are stored only on the host machine, just like a temporary disk. With this configuration, you get lower read/write latency, together with faster node scaling and cluster upgrades.
37
36
@@ -72,19 +71,19 @@ To help determine best fit for your workload between Azure Files and Azure NetAp
72
71
73
72
Use [Azure Disk][azure-disk-csi] to create a Kubernetes *DataDisk* resource. Disks types include:
74
73
75
-
*Ultra Disks
76
-
*Premium SSDs
74
+
*Premium SSDs (recommended for most workloads)
75
+
*Ultra disks
77
76
* Standard SSDs
78
77
* Standard HDDs
79
78
80
79
> [!TIP]
81
-
> For most production and development workloads, use Premium SSD.
80
+
> For most production and development workloads, use Premium SSDs.
82
81
83
-
Because Azure Disk is mounted as *ReadWriteOnce*, they're only available to a single node. For storage volumes accessible by pods on multiple nodes simultaneously, use Azure Files.
82
+
Because an Azure Disk is mounted as *ReadWriteOnce*, it's only available to a single node. For storage volumes accessible by pods on multiple nodes simultaneously, use Azure Files.
84
83
85
84
### Azure Files
86
85
87
-
Use [Azure Files][azure-files-csi] to mount a Server Message Block (SMB) version 3.1.1 share or Network File System (NFS) version 4.1 share backed by an Azure storage account to pods. Azure Files let you share data across multiple nodes and pods and can use:
86
+
Use [Azure Files][azure-files-csi] to mount a Server Message Block (SMB) version 3.1.1 share or Network File System (NFS) version 4.1 share. Azure Files let you share data across multiple nodes and pods and can use:
88
87
89
88
* Azure Premium storage backed by high-performance SSDs
90
89
* Azure Standard storage backed by regular HDDs
@@ -99,11 +98,11 @@ Use [Azure Files][azure-files-csi] to mount a Server Message Block (SMB) version
99
98
100
99
Use [Azure Blob Storage][azure-blob-csi] to create a blob storage container and mount it using the NFS v3.0 protocol or BlobFuse.
101
100
102
-
* Block Blobs
101
+
* Block blobs
103
102
104
103
### Volume types
105
104
106
-
Kubernetes volumes represent more than just a traditional disk for storing and retrieving information. Kubernetes volumes can also be used as a way to inject data into a pod for use by the containers.
105
+
Kubernetes volumes represent more than just a traditional disk for storing and retrieving information. Kubernetes volumes can also be used as a way to inject data into a pod for use by its containers.
107
106
108
107
Common volume types in Kubernetes include:
109
108
@@ -115,11 +114,11 @@ Commonly used as temporary space for a pod. All containers within a pod can acce
115
114
116
115
You can use *secret* volumes to inject sensitive data into pods, such as passwords.
117
116
118
-
1. Create a Secret using the Kubernetes API.
119
-
1. Define your pod or deployment and request a specific Secret.
117
+
1. Create a secret using the Kubernetes API.
118
+
1. Define your pod or deployment and request a specific secret.
120
119
* Secrets are only provided to nodes with a scheduled pod that requires them.
121
-
* The Secret is stored in *tmpfs*, not written to disk.
122
-
1. When you delete the last pod on a node requiring a Secret, the Secret is deleted from the node's tmpfs.
120
+
* The secret is stored in *tmpfs*, not written to disk.
121
+
1. When you delete the last pod on a node requiring a secret, the secret is deleted from the node's tmpfs.
123
122
* Secrets are stored within a given namespace and are only accessed by pods within the same namespace.
124
123
125
124
#### configMap
@@ -136,46 +135,46 @@ Like using a secret:
136
135
137
136
Volumes defined and created as part of the pod lifecycle only exist until you delete the pod. Pods often expect their storage to remain if a pod is rescheduled on a different host during a maintenance event, especially in StatefulSets. A *persistent volume* (PV) is a storage resource created and managed by the Kubernetes API that can exist beyond the lifetime of an individual pod.
138
137
139
-
You can use the following Azure Storage data services to provide the PersistentVolume:
138
+
You can use the following Azure Storage data services to provide the persistent volume:
As noted in the [Volumes](#volumes) section, the choice of Disks or Files is often determined by the need for concurrent access to the data or the performance tier.
144
+
As noted in the [Volumes](#volumes) section, the choice of Azure Disks or Azure Files is often determined by the need for concurrent access to the data or the performance tier.
146
145
147
146

148
147
149
-
A cluster administrator can *statically* create a PersistentVolume, or the volume is created *dynamically* by the Kubernetes API server. If a pod is scheduled and requests currently unavailable storage, Kubernetes can create the underlying Azure Disk or File storage and attach it to the pod. Dynamic provisioning uses a *StorageClass* to identify what type of Azure storage needs to be created.
148
+
A cluster administrator can *statically* create a persistent volume, or a volume can be created *dynamically* by the Kubernetes API server. If a pod is scheduled and requests storage that is currently unavailable, Kubernetes can create the underlying Azure Disk or File storage and attach it to the pod. Dynamic provisioning uses a *storage class* to identify what type of resource needs to be created.
150
149
151
150
> [!IMPORTANT]
152
151
> Persistent volumes can't be shared by Windows and Linux pods due to differences in file system support between the two operating systems.
153
152
154
153
## Storage classes
155
154
156
-
To define different tiers of storage, such as Premium and Standard, you can create a *StorageClass*.
155
+
To specify different tiers of storage, such as premium or standard, you can create a *storage class*.
157
156
158
-
The StorageClass also defines the *reclaimPolicy*. When you delete the persistent volume, the reclaimPolicy controls the behavior of the underlying Azure storage resource. The underlying storage resource can either be deleted or kept for use with a future pod.
157
+
A storage class also defines a *reclaim policy*. When you delete the persistent volume, the reclaim policy controls the behavior of the underlying Azure Storage resource. The underlying resource can either be deleted or kept for use with a future pod.
159
158
160
-
For clusters using the [Container Storage Interface (CSI) drivers][csi-storage-drivers] the following extra `StorageClasses` are created:
159
+
For clusters using the [Container Storage Interface (CSI) drivers][csi-storage-drivers] the following extra storage classes are created:
161
160
162
161
| Storage class | Description |
163
162
|---|---|
164
-
|`managed-csi`| Uses Azure StandardSSD locally redundant storage (LRS) to create a Managed Disk. The reclaim policy ensures that the underlying Azure Disk is deleted when the persistent volume that used it's deleted. The storage class also configures the persistent volumes to be expandable, you just need to edit the persistent volume claim with the new size. |
165
-
|`managed-csi-premium`| Uses Azure Premium locally redundant storage (LRS) to create a Managed Disk. The reclaim policy again ensures that the underlying Azure Disk is deleted when the persistent volume that used it's deleted. Similarly, this storage class allows for persistent volumes to be expanded. |
163
+
|`managed-csi`| Uses Azure Standard SSD locally redundant storage (LRS) to create a managed disk. The reclaim policy ensures that the underlying Azure Disk is deleted when the persistent volume that used it is deleted. The storage class also configures the persistent volumes to be expandable. You can edit the persistent volume claim to specify the new size. |
164
+
|`managed-csi-premium`| Uses Azure Premium locally redundant storage (LRS) to create a managed disk. The reclaim policy again ensures that the underlying Azure Disk is deleted when the persistent volume that used it is deleted. Similarly, this storage class allows for persistent volumes to be expanded. |
166
165
|`azurefile-csi`| Uses Azure Standard storage to create an Azure file share. The reclaim policy ensures that the underlying Azure file share is deleted when the persistent volume that used it is deleted. |
167
-
|`azurefile-csi-premium`| Uses Azure Premium storage to create an Azure file share. The reclaim policy ensures that the underlying Azure file share is deleted when the persistent volume that used it's deleted.|
168
-
|`azureblob-nfs-premium`| Uses Azure Premium storage to create an Azure Blob storage container and connect using the NFS v3 protocol. The reclaim policy ensures that the underlying Azure Blob storage container is deleted when the persistent volume that used it's deleted. |
169
-
|`azureblob-fuse-premium`| Uses Azure Premium storage to create an Azure Blob storage container and connect using BlobFuse. The reclaim policy ensures that the underlying Azure Blob storage container is deleted when the persistent volume that used it's deleted. |
166
+
|`azurefile-csi-premium`| Uses Azure Premium storage to create an Azure file share. The reclaim policy ensures that the underlying Azure file share is deleted when the persistent volume that used it is deleted.|
167
+
|`azureblob-nfs-premium`| Uses Azure Premium storage to create an Azure Blob storage container and connect using the NFS v3 protocol. The reclaim policy ensures that the underlying Azure Blob storage container is deleted when the persistent volume that used it is deleted. |
168
+
|`azureblob-fuse-premium`| Uses Azure Premium storage to create an Azure Blob storage container and connect using BlobFuse. The reclaim policy ensures that the underlying Azure Blob storage container is deleted when the persistent volume that used it is deleted. |
170
169
171
-
Unless you specify a StorageClass for a persistent volume, the default StorageClass is used. Ensure volumes use the appropriate storage you need when requesting persistent volumes.
170
+
Unless you specify a storage class for a persistent volume, the default storage class is used. Ensure volumes use the appropriate storage you need when requesting persistent volumes.
172
171
173
172
> [!IMPORTANT]
174
173
> Starting with Kubernetes version 1.21, AKS only uses CSI drivers by default and CSI migration is enabled. While existing in-tree persistent volumes continue to function, starting with version 1.26, AKS will no longer support volumes created using in-tree driver and storage provisioned for files and disk.
175
174
>
176
175
> The `default` class will be the same as `managed-csi`.
177
176
178
-
You can create a StorageClass for other needs using `kubectl`. The following example uses Premium Managed Disks and specifies that the underlying Azure Disk should be *retained* when you delete the pod:
177
+
You can create a storage class for other needs using `kubectl`. The following example uses premium managed disks and specifies that the underlying Azure Disk should be *retained* when you delete the pod:
179
178
180
179
```yaml
181
180
apiVersion: storage.k8s.io/v1
@@ -197,15 +196,15 @@ For more information about storage classes, see [StorageClass in Kubernetes](htt
197
196
198
197
## Persistent volume claims
199
198
200
-
A PersistentVolumeClaim requests storage of a particular StorageClass, access mode, and size. The Kubernetes API server can dynamically provision the underlying Azure storage resource if no existing resource can fulfill the claim based on the defined StorageClass.
199
+
A persistent volume claim (PVC) requests storage of a particular storage class, access mode, and size. The Kubernetes API server can dynamically provision the underlying Azure Storage resource if no existing resource can fulfill the claim based on the defined storage class.
201
200
202
201
The pod definition includes the volume mount once the volume has been connected to the pod.
203
202
204
203

205
204
206
-
Once an available storage resource has been assigned to the pod requesting storage, PersistentVolume is *bound* to a PersistentVolumeClaim. Persistent volumes are 1:1 mapped to claims.
205
+
Once an available storage resource has been assigned to the pod requesting storage, the persistent volume is *bound* to a persistent volume claim. Persistent volumes are mapped to claims in a 1:1 mapping.
207
206
208
-
The following example YAML manifest shows a persistent volume claim that uses the *managed-premium* StorageClass and requests a Disk *5Gi* in size:
207
+
The following example YAML manifest shows a persistent volume claim that uses the *managed-premium* storage class and requests an Azure Disk that is *5Gi* in size:
209
208
210
209
```yaml
211
210
apiVersion: v1
@@ -224,7 +223,7 @@ spec:
224
223
When you create a pod definition, you also specify:
225
224
226
225
* The persistent volume claim to request the desired storage.
227
-
* The *volumeMount* for your applications to read and write data.
226
+
* The *volume mount* for your applications to read and write data.
228
227
229
228
The following example YAML manifest shows how the previous persistent volume claim can be used to mount a volume at */mnt/azure*:
230
229
@@ -250,11 +249,11 @@ For mounting a volume in a Windows container, specify the drive letter and path.
250
249
251
250
```yaml
252
251
...
253
-
volumeMounts:
254
-
- mountPath: "d:"
255
-
name: volume
256
-
- mountPath: "c:\k"
257
-
name: k-dir
252
+
volumeMounts:
253
+
- mountPath: "d:"
254
+
name: volume
255
+
- mountPath: "c:\k"
256
+
name: k-dir
258
257
...
259
258
```
260
259
@@ -264,19 +263,19 @@ For associated best practices, see [Best practices for storage and backups in AK
264
263
265
264
To see how to use CSI drivers, see the following how-to articles:
266
265
267
-
-[Container Storage Interface (CSI) drivers for Azure Disk, Azure Files, and Azure Blob storage on Azure Kubernetes Service][csi-storage-drivers]
268
-
-[Use Azure Disk CSI driver in Azure Kubernetes Service][azure-disk-csi]
269
-
-[Use Azure Files CSI driver in Azure Kubernetes Service][azure-files-csi]
270
-
-[Use Azure Blob storage CSI driver in Azure Kubernetes Service][azure-blob-csi]
271
-
-[Configure Azure NetApp Files with Azure Kubernetes Service][azure-netapp-files]
266
+
*[Container Storage Interface (CSI) drivers for Azure Disk, Azure Files, and Azure Blob storage on Azure Kubernetes Service][csi-storage-drivers]
267
+
*[Use Azure Disk CSI driver in Azure Kubernetes Service][azure-disk-csi]
268
+
*[Use Azure Files CSI driver in Azure Kubernetes Service][azure-files-csi]
269
+
*[Use Azure Blob storage CSI driver in Azure Kubernetes Service][azure-blob-csi]
270
+
*[Configure Azure NetApp Files with Azure Kubernetes Service][azure-netapp-files]
272
271
273
272
For more information on core Kubernetes and AKS concepts, see the following articles:
274
273
275
-
-[Kubernetes / AKS clusters and workloads][aks-concepts-clusters-workloads]
276
-
-[Kubernetes / AKS identity][aks-concepts-identity]
277
-
-[Kubernetes / AKS security][aks-concepts-security]
278
-
-[Kubernetes / AKS virtual networks][aks-concepts-network]
279
-
-[Kubernetes / AKS scale][aks-concepts-scale]
274
+
*[Kubernetes / AKS clusters and workloads][aks-concepts-clusters-workloads]
275
+
*[Kubernetes / AKS identity][aks-concepts-identity]
276
+
*[Kubernetes / AKS security][aks-concepts-security]
277
+
*[Kubernetes / AKS virtual networks][aks-concepts-network]
278
+
*[Kubernetes / AKS scale][aks-concepts-scale]
280
279
281
280
<!-- EXTERNAL LINKS -->
282
281
@@ -303,4 +302,3 @@ For more information on core Kubernetes and AKS concepts, see the following arti
0 commit comments