Managing persistent storage for applications running in AKS is crucial. AKS provides several options to integrate with Azure's robust storage services, allowing you to choose the best fit for your application's performance, durability, and cost requirements.
In Kubernetes, storage is typically managed through:
Azure Disk Storage offers highly performant, durable block storage for your AKS workloads. It's ideal for stateful applications that require low latency and high throughput.
AKS can dynamically provision Azure Managed Disks for your Pods using StorageClasses. This is the recommended approach for most use cases.
Example StorageClass configuration for Premium SSD:
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: managed-premium
provisioner: disk.csi.azure.com
parameters:
skuName: Premium_LRS
location: eastus
reclaimPolicy: Delete
volumeBindingMode: Immediate
Azure Files provides fully managed cloud file shares that are accessible via the Server Message Block (SMB) and Network File System (NFS) protocols. It's suitable for shared access scenarios and applications that rely on file-based storage.
AKS can mount Azure Files shares directly into Pods. This is excellent for scenarios where multiple Pods need to access the same data, like shared content management systems or configuration files.
Example StorageClass for Azure Files (Standard LRS):
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: azurefile-csi-standard
provisioner: file.csi.azure.com
parameters:
skuName: Standard_LRS
location: eastus
reclaimPolicy: Delete
volumeBindingMode: Immediate
While not directly mountable as a traditional filesystem within AKS Pods by default, Azure Blob Storage can be integrated with applications using SDKs or through third-party solutions like BlobFuse CSI driver for more advanced scenarios.
Ideal for unstructured data like images, backups, logs, and large media files.
For direct mounting, consider the Blob CSI Driver.