On this page

Azure Kubernetes Service (AKS) Storage

Introduction to Storage in AKS

Managing persistent storage for stateful applications in Kubernetes can be complex. Azure Kubernetes Service (AKS) integrates seamlessly with Azure's robust storage solutions to provide reliable and scalable persistent storage for your containerized workloads. This documentation outlines the various storage options available in AKS, how to provision and manage them, and best practices for optimal performance and reliability.

Understanding Kubernetes storage concepts like PersistentVolumes (PVs), PersistentVolumeClaims (PVCs), and StorageClasses is fundamental to effectively using storage in AKS.

Available Storage Options

AKS supports several Azure storage solutions, each offering different performance characteristics, features, and cost-effectiveness:

Kubernetes Persistent Storage Concepts

StorageClasses

A StorageClass provides a way for administrators to describe the "classes" of storage they offer. Different classes might map to quality-of-service levels, backup policies, or arbitrary policies determined by the cluster administrators. Kubernetes itself doesn't know what a particular class means, only the provisioner that is used to provision the storage.

In AKS, StorageClasses are used to dynamically provision Azure Disks and Azure Files.

apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: managed-csi-premium
provisioner: disk.csi.azure.com
parameters:
  skuName: Premium_LRS
  location: eastus
reclaimPolicy: Delete
volumeBindingMode: Immediate
allowVolumeExpansion: true

PersistentVolumeClaims

A PersistentVolumeClaim (PVC) is a request for storage by a user. It is similar to a pod consuming node resources. Pods request specific sizes and access modes (e.g., ReadWriteOnce, ReadOnlyMany, ReadWriteMany). A PVC is tied to the set of volumes that the matching StorageClass provides.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-pvc
spec:
  accessModes:
    - ReadWriteOnce
  storageClassName: managed-csi-premium
  resources:
    requests:
      storage: 10Gi

PersistentVolumes

A PersistentVolume (PV) is a piece of storage in the cluster that has been provisioned by an administrator or dynamically provisioned using StorageClasses. It is a cluster resource. PVs have a lifecycle independent of any individual pod that uses the PV.

When you use dynamic provisioning with a StorageClass, AKS automatically creates PV objects to represent the provisioned Azure Disks or Azure Files.

Azure Disk Storage in AKS

Azure Disk Storage provides highly performant, durable block storage for your AKS workloads. It's suitable for applications requiring low latency and high throughput, such as databases or stateful applications.

Key Features:

Provisioning with StorageClasses:

AKS provides built-in StorageClasses for Azure Disks:

You can also create custom StorageClasses to specify different SKUs, locations, and other parameters.

Learn More about Azure Disk Storage in AKS

Azure Files Storage in AKS

Azure Files offers fully managed cloud file shares that can be accessed by multiple nodes and pods concurrently using the SMB or NFS protocols. This is ideal for shared configuration files, application data accessible by multiple instances, or migrating traditional file-share workloads.

Key Features:

Provisioning with StorageClasses:

Use the built-in StorageClasses like azurefile-csi-premium or azurefile-csi-standard, or define your own.

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-azurefile-pvc
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: azurefile-csi-premium
  resources:
    requests:
      storage: 50Gi
Learn More about Azure Files Storage in AKS

Azure NetApp Files in AKS

Azure NetApp Files is an enterprise-grade file storage service built on NetApp technology. It provides extremely high performance, low latency, and advanced data management features, making it suitable for the most demanding workloads like SAP HANA, Oracle, and other mission-critical applications.

Key Features:

Integration with AKS requires setting up Azure NetApp Files and configuring custom StorageClasses.

Learn More about Azure NetApp Files in AKS

Storage Best Practices in AKS