OpenShift Container Platform supports GCE Persistent Disk volumes (gcePD). You can provision your OpenShift Container Platform 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 OpenShift Container Platform cluster. Persistent volume claims are specific to a project or namespace and can be requested by users.
OpenShift Container Platform defaults to using an in-tree (non-CSI) plug-in to provision gcePD storage.
In future OpenShift Container Platform versions, volumes provisioned using existing in-tree plug-ins are planned for migration to their 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.
After full migration, in-tree plug-ins will eventually be removed in future versions of OpenShift Container Platform.
High availability of storage in the infrastructure is left to the underlying storage provider.
Storage classes are used to differentiate and delineate storage levels and usages. By defining a storage class, users can obtain dynamically provisioned persistent volumes.
In the OpenShift Container Platform console, click Storage → Storage Classes.
On the StorageClasses overview page, click Create Storage Class.
On the StorageClasses create page, enter values as desired:
Enter a name to reference the storage class.
Enter an optional description.
Select the reclaim policy.
kubernetes.io/gce-pd from the Provisioner drop-down list.
Enter additional parameters for the storage class as desired.
Storage must exist in the underlying infrastructure before it can be mounted as a volume in OpenShift Container Platform.
In the OpenShift Container Platform console, click Storage → Persistent Volume Claims.
In the persistent volume claims overview, click Create Persistent Volume Claim.
Define the desired options on the page that appears.
Select the storage class created previously from the drop-down menu.
Enter a unique name for the storage claim.
Select the access mode. This determines the read and write access for the created storage claim.
Define the size of the storage claim.
Click Create to create the persistent volume claim and generate a persistent volume.
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
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 using unformatted GCE volumes as persistent volumes, because OpenShift Container Platform formats them before the first use.