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
description: Learn about storage in Azure Kubernetes Service (AKS), including volumes, persistent volumes, storage classes, and claims
4
4
services: container-service
5
5
ms.topic: conceptual
6
-
ms.date: 03/08/2022
6
+
ms.date: 08/10/2022
7
7
8
8
---
9
9
10
10
# Storage options for applications in Azure Kubernetes Service (AKS)
11
11
12
-
Applications running in Azure Kubernetes Service (AKS) may need to store and retrieve data. While some application workloads can use local, fast storage on unneeded, emptied nodes, others require storage that persists on more regular data volumes within the Azure platform.
12
+
Applications running in Azure Kubernetes Service (AKS) may need to store and retrieve data. While some application workloads can use local, fast storage on unneeded, emptied nodes, others require storage that persists on more regular data volumes within the Azure platform.
13
13
14
14
Multiple pods may need to:
15
-
* Share the same data volumes.
16
-
* Reattach data volumes if the pod is rescheduled on a different node.
17
15
18
-
Finally, you may need to inject sensitive data or application configuration information into pods.
16
+
* Share the same data volumes.
17
+
* Reattach data volumes if the pod is rescheduled on a different node.
18
+
19
+
Finally, you might need to collect and store sensitive data or application configuration information into pods.
19
20
20
21
This article introduces the core concepts that provide storage to your applications in AKS:
21
22
@@ -30,36 +31,44 @@ This article introduces the core concepts that provide storage to your applicati
30
31
31
32
Kubernetes typically treats individual pods as ephemeral, disposable resources. Applications have different approaches available to them for using and persisting data. A *volume* represents a way to store, retrieve, and persist data across pods and through the application lifecycle.
32
33
33
-
Traditional volumes are created as Kubernetes resources backed by Azure Storage. You can manually create data volumes to be assigned to pods directly, or have Kubernetes automatically create them. Data volumes can use: [Azure Disks][disks-types], [Azure Files][storage-files-planning], [Azure NetApp Files][azure-netapp-files-service-levels], or [Azure Blobs][storage-account-overview].
34
+
Traditional volumes are created as Kubernetes resources backed by Azure Storage. You can manually create data volumes to be assigned to pods directly, or have Kubernetes automatically create them. Data volumes can use: [Azure Disks][disks-types], [Azure Files][storage-files-planning], [Azure NetApp Files][azure-netapp-files-service-levels], or [Azure Blobs][storage-account-overview].
34
35
35
36
### Azure Disks
36
37
37
-
Use *Azure Disks* to create a Kubernetes *DataDisk* resource. Disks types include:
38
+
Use *Azure Disks* to create a Kubernetes *DataDisk* resource. Disks types include:
39
+
38
40
* Ultra Disks
39
41
* Premium SSDs
40
42
* Standard SSDs
41
43
* Standard HDDs
42
44
43
45
> [!TIP]
44
-
>For most production and development workloads, use Premium SSD.
46
+
>For most production and development workloads, use Premium SSD.
45
47
46
48
Since Azure Disks are mounted as *ReadWriteOnce*, they're only available to a single node. For storage volumes that can be accessed by pods on multiple nodes simultaneously, use Azure Files.
47
49
48
50
### Azure Files
49
-
Use *Azure Files* to mount an SMB 3.1.1 share or NFS 4.1 share backed by an Azure storage accounts to pods. Files let you share data across multiple nodes and pods and can use:
51
+
52
+
Use *Azure Files* 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 accounts to pods. Files let you share data across multiple nodes and pods and can use:
53
+
50
54
* Azure Premium storage backed by high-performance SSDs
51
55
* Azure Standard storage backed by regular HDDs
52
56
53
57
### Azure NetApp Files
54
-
* Ultra Storage
58
+
59
+
* Ultra Storage
55
60
* Premium Storage
56
-
* Standard Storage
61
+
* Standard Storage
57
62
58
63
### Azure Blob Storage
59
-
* Block Blobs
64
+
65
+
Use *Azure Blob Storage* to create a blob storage container and mount it using the NFS v3.0 protocol or BlobFuse.
66
+
67
+
* Block Blobs
60
68
61
69
### Volume types
62
-
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.
70
+
71
+
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.
63
72
64
73
Common volume types in Kubernetes include:
65
74
@@ -69,21 +78,23 @@ Commonly used as temporary space for a pod. All containers within a pod can acce
69
78
70
79
#### secret
71
80
72
-
You can use *secret* volumes to inject sensitive data into pods, such as passwords.
73
-
1. Create a Secret using the Kubernetes API.
74
-
1. Define your pod or deployment and request a specific Secret.
81
+
You can use *secret* volumes to inject sensitive data into pods, such as passwords.
82
+
83
+
1. Create a Secret using the Kubernetes API.
84
+
1. Define your pod or deployment and request a specific Secret.
75
85
* Secrets are only provided to nodes with a scheduled pod that requires them.
76
-
* The Secret is stored in *tmpfs*, not written to disk.
86
+
* The Secret is stored in *tmpfs*, not written to disk.
77
87
1. When you delete the last pod on a node requiring a Secret, the Secret is deleted from the node's tmpfs.
78
88
* Secrets are stored within a given namespace and can only be accessed by pods within the same namespace.
79
89
80
90
#### configMap
81
91
82
-
You can use *configMap* to inject key-value pair properties into pods, such as application configuration information. Define application configuration information as a Kubernetes resource, easily updated and applied to new instances of pods as they're deployed.
92
+
You can use *configMap* to inject key-value pair properties into pods, such as application configuration information. Define application configuration information as a Kubernetes resource, easily updated and applied to new instances of pods as they're deployed.
83
93
84
-
Like using a Secret:
85
-
1. Create a ConfigMap using the Kubernetes API.
86
-
1. Request the ConfigMap when you define a pod or deployment.
94
+
Like using a secret:
95
+
96
+
1. Create a ConfigMap using the Kubernetes API.
97
+
1. Request the ConfigMap when you define a pod or deployment.
87
98
* ConfigMaps are stored within a given namespace and can only be accessed by pods within the same namespace.
88
99
89
100
## Persistent volumes
@@ -110,6 +121,8 @@ For clusters using the [Container Storage Interface (CSI) drivers][csi-storage-d
110
121
|`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. |
111
122
|`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. |
112
123
|`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.|
124
+
|`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. |
125
+
|`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. |
113
126
114
127
Unless you specify a StorageClass for a persistent volume, the default StorageClass will be used. Ensure volumes use the appropriate storage you need when requesting persistent volumes.
115
128
@@ -136,7 +149,7 @@ allowVolumeExpansion: true
136
149
137
150
## Persistent volume claims
138
151
139
-
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.
152
+
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.
140
153
141
154
The pod definition includes the volume mount once the volume has been connected to the pod.
142
155
@@ -161,8 +174,9 @@ spec:
161
174
```
162
175
163
176
When you create a pod definition, you also specify:
164
-
* The persistent volume claim to request the desired storage.
165
-
* The *volumeMount* for your applications to read and write data.
177
+
178
+
* The persistent volume claim to request the desired storage.
179
+
* The *volumeMount* for your applications to read and write data.
166
180
167
181
The following example YAML manifest shows how the previous persistent volume claim can be used to mount a volume at */mnt/azure*:
168
182
@@ -202,10 +216,11 @@ For associated best practices, see [Best practices for storage and backups in AK
202
216
203
217
To see how to use CSI drivers, see the following how-to articles:
204
218
205
-
-[Enable Container Storage Interface(CSI) drivers for Azure disks and Azure Files on Azure Kubernetes Service(AKS)][csi-storage-drivers]
206
-
-[Use Azure disk Container Storage Interface(CSI) drivers in Azure Kubernetes Service(AKS)][azure-disk-csi]
0 commit comments