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.

Azure Disk volumes can be
provisioned
dynamically. Persistent volumes are not bound to a single project or namespace;
they can be shared across the OpenShift Container Platform cluster.
Persistent
volume claims, however, are specific to a project or namespace and can be
requested by users.

High availability of storage in the infrastructure is left to the underlying
storage provider.

Prerequisites

Each node host in the infrastructure must match the Azure virtual machine name.

Each node host must be in the same resource group.

Provisioning

Storage must exist in the underlying infrastructure before it can be mounted as
a volume in OpenShift Container Platform. After ensuring OpenShift Container Platform is
configured
for Azure Disk, all that is required for OpenShift Container Platform and Azure is an Azure
Disk Name and Disk URI and the PersistentVolume API.

Configuring Azure Disk for regional cloud

Azure has multiple regions on which to deploy an instance. To specify a desired region, add the following to the azure.conf file:

cloud: <region>

The region can be any of the following:

German cloud: AZUREGERMANCLOUD

China cloud: AZURECHINACLOUD

Public cloud: AZUREPUBLICCLOUD

US cloud: AZUREUSGOVERNMENTCLOUD

Creating the Persistent Volume

Azure does not support the Recycle reclaim policy.

You must define your persistent volume in an object definition before creating
it in OpenShift Container Platform:

For a pod that has a mounted volume through an Azure disk PVC, scheduling the
pod to a new node takes a few minutes. Wait for two to three minutes to complete
the Disk Detach operation, and then start a new deployment. If a new pod
creation request is started before completing the Disk Detach operation, the
Disk Attach operation initiated by the pod creation fails, resulting in pod
creation failure.

Persistent volume claims only exist in the user’s namespace and can only be
referenced by a pod within that same namespace. Any attempt to access a
persistent volume from a different namespace causes the pod to fail.

Volume Format

Before OpenShift Container Platform mounts the volume and passes it to a container, it checks
that it contains a file system as specified by the fsType parameter in the
persistent volume definition. If the device is not formatted with the file
system, all data from the device is erased and the device is automatically
formatted with the given file system.

This allows unformatted Azure volumes to be used as persistent volumes because
OpenShift Container Platform formats them before the first use.