OKD supports GCE Persistent Disk volumes (gcePD). You can provision your OKD cluster with persistent storage using GCE. Some familiarity with Kubernetes and GCE is assumed.
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.
GCE Persistent Disk volumes can be provisioned dynamically.
Persistent volumes are not bound to a single project or namespace; they can be shared across the OKD cluster. Persistent volume claims are specific to a project or namespace and can be requested by users.
|
OKD 4.12 and later provides automatic migration for the GCE Persist Disk in-tree volume plugin to its equivalent CSI driver. CSI automatic migration should be seamless. Migration does not change how you use all existing API objects, such as persistent volumes, persistent volume claims, and storage classes. For more information about migration, see CSI automatic migration. |
|
High availability of storage in the infrastructure is left to the underlying storage provider. |
To enable dynamic provisioning of persistent volumes, create a storage class that defines storage characteristics and allows users to automatically provision volumes on-demand.
You can create a persistent volume claim to dynamically provision and bind storage from a pre-configured storage class, so that your applications can consume persistent storage in OKD.
Storage must exist in the underlying infrastructure before it can be mounted as a volume in OKD.
In the OKD web console, click Storage → Persistent Volume Claims.
In the persistent volume claims overview, click Create Persistent Volume Claim.
Define the required options on the page that is displayed.
Select the previously-created storage class from the drop-down menu.
Enter a unique name for the storage claim.
Select the access mode. This selection determines the read and write access for the storage claim.
Define the size of the storage claim.
Click Create to create the persistent volume claim and generate a persistent volume.
You can use unformatted GCE volumes as persistent volumes, because OKD automatically formats the device before mounting it to a container.
Before OKD mounts the volume and passes it to a container, it checks that the volume 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.