
To define different tiers of storage, such as Premium and Standard, you can create a StorageClass. Dynamic provisioning uses a StorageClass to identify what type of Azure storage needs to be created. If a pod is scheduled and requests currently unavailable storage, Kubernetes can create the underlying Azure Disk or Files storage and attach it to the pod. As noted in the Volumes section, the choice of Disks or Files is often determined by the need for concurrent access to the data or the performance tier.Ī PersistentVolume can be statically created by a cluster administrator, or dynamically created by the Kubernetes API server. You can use Azure Disks or Files to provide the PersistentVolume. 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. Pods often expect their storage to remain if a pod is rescheduled on a different host during a maintenance event, especially in StatefulSets. Volumes defined and created as part of the pod lifecycle only exist until you delete the pod.
ConfigMaps are stored within a given namespace and can only be accessed by pods within the same namespace. Request the ConfigMap when you define a pod or deployment. Create a ConfigMap using the Kubernetes API. Define application configuration information as a Kubernetes resource, easily updated and applied to new instances of pods as they're deployed. You can use configMap to inject key-value pair properties into pods, such as application configuration information. Secrets are stored within a given namespace and can only be accessed by pods within the same namespace. When you delete the last pod on a node requiring a Secret, the Secret is deleted from the node's tmpfs. The Secret is stored in tmpfs, not written to disk. Secrets are only provided to nodes with a scheduled pod that requires them. Define your pod or deployment and request a specific Secret. Create a Secret using the Kubernetes API. You can use secret volumes to inject sensitive data into pods, such as passwords. This volume typically uses the underlying local node disk storage, though it can also exist only in the node's memory. Once you delete the pod, the volume is deleted. Data written to this volume type persists only for the lifespan of the pod. All containers within a pod can access the data on the volume. Kubernetes volumes can also be used as a way to inject data into a pod for use by the containers.Ĭommon volume types in Kubernetes include: emptyDirĬommonly used as temporary space for a pod. Kubernetes volumes represent more than just a traditional disk for storing and retrieving information. Azure Standard storage backed by regular HDDs. Azure Premium storage backed by high-performance SSDs. Files let you share data across multiple nodes and pods and can use: Use Azure Files to mount an SMB 3.1.1 share or NFS 4.1 share backed by an Azure storage accounts to pods. For storage volumes that can be accessed by multiple pods simultaneously, use Azure Files.
Since Azure Disks are mounted as ReadWriteOnce, they're only available to a single pod. Disks types include:įor most production and development workloads, use Premium SSD. Use Azure Disks to create a Kubernetes DataDisk resource. Data volumes can use: Azure Disks, Azure Files, Azure NetApp Files, or Azure Blobs.
You can manually create data volumes to be assigned to pods directly, or have Kubernetes automatically create them. Traditional volumes are created as Kubernetes resources backed by Azure Storage. A volume represents a way to store, retrieve, and persist data across pods and through the application lifecycle. Applications have different approaches available to them for using and persisting data. Kubernetes typically treats individual pods as ephemeral, disposable resources. This article introduces the core concepts that provide storage to your applications in AKS:
Reattach data volumes if the pod is rescheduled on a different node.įinally, you may need to inject sensitive data or application configuration information into pods. 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. Applications running in Azure Kubernetes Service (AKS) may need to store and retrieve data.