Persistent storage using Azure File
The Kubernetes persistent volume framework allows administrators to provision a cluster with persistent storage and gives users a way to request those resources without having any knowledge of the underlying infrastructure. You can provision Azure File volumes dynamically.
Persistent volumes are not bound to a single project or namespace, and you can share them across the OKD cluster. Persistent volume claims are specific to a project or namespace, and can be requested by users for use in applications.
Azure File volumes use Server Message Block. |
Additional resources
To create the persistent volume claim, you must first define a object that contains the Azure account and key. This secret is used in the PersistentVolume
definition, and will be referenced by the persistent volume claim for use in applications.
Prerequisites
An Azure File share exists.
The credentials to access this share, specifically the storage account and key, are available.
Create a
PersistentVolume
object that references the object you created:1 The name of the persistent volume. 2 The size of this persistent volume. 3 The name of the secret that contains the Azure File share credentials. 4 The name of the Azure File share. Create a
PersistentVolumeClaim
object that maps to the persistent volume you created:
Mount the Azure File share in a pod
After the persistent volume claim has been created, it can be used inside by an application. The following example demonstrates mounting this share inside of a pod.
Prerequisites
Create a pod that mounts the existing persistent volume claim:
1 The name of the pod. 2 The path to mount the Azure File share inside the pod. Do not mount to the container root, , or any path that is the same in the host and the container. This can corrupt your host system if the container is sufficiently privileged, such as the host /dev/pts
files. It is safe to mount the host by using/host
.3 The name of the PersistentVolumeClaim
object that has been previously created.