Deploy Object Storage on OpenShift nodes with PersistentVolumes

Deploy the Object Storage service (swift) on OpenShift nodes by using PersistentVolumes (PVs) for storage. A default deployment uses at least two swiftProxy replicas and three swiftStorage replicas. You can adjust these values to distribute storage across more nodes and disks.

About this task

The ringReplicas value defines the number of object copies in the cluster. For example, if you set ringReplicas: 3 and swiftStorage/replicas: 5, every object is stored on 3 different PersistentVolumes (PVs), and there are 5 PVs in total.

Limitations
  • The PersistentVolumes used for Object Storage must be formatted with the XFS file system. The Object Storage service stores metadata in XFS extended attributes (xattrs), which require XFS for reliable support. The Object Storage service does not support other file systems.
  • Use only local disks for Object Storage PersistentVolumes. The Object Storage service does not support network-attached storage, including NFS.
Considerations
  • When you increase the number of swiftStorage replicas, the swift-operator automatically rebalances the rings to distribute data across the new PersistentVolumes. Verify that the ring rebalance has completed successfully and all data has been moved to its new location before performing another rebalance. For more information, see Rebalance Object Storage rings.

Procedure

  1. Open your OpenStackControlPlane CR file, openstack_control_plane.yaml, and add the following parameters to the swift template:
    apiVersion: core.openstack.org/v1beta1
    kind: OpenStackControlPlane
    metadata:
      name: openstack-control-plane
      namespace: openstack
    spec:
      ...
      swift:
        enabled: true
        template:
          swiftProxy:
            replicas: 2
          swiftRing:
            ringReplicas: 3
          swiftStorage:
            replicas: 3
            storageClass: <swift-storage>
            storageRequest: 100Gi
    ...

    where:

    swiftProxy.replicas
    The number of API proxy instances to handle incoming requests.
    swiftRing.ringReplicas
    The number of redundant copies of each object maintained across the cluster.
    swiftStorage.replicas
    The number of storage nodes (and PVCs) to deploy. This should be greater than or equal to ringReplicas.
    <swift-storage>
    The name of the StorageClass used to provision local XFS-formatted volumes.
    swiftStorage.storageRequest
    The size of the volume allocated to each storage replica.
  2. Update the control plane:
    $ oc apply -f openstack_control_plane.yaml -n openstack
  3. Wait until OpenShift creates the resources related to the OpenStackControlPlane CR. Run the following command to check the status:
    $ oc get openstackcontrolplane -n openstack

    The OpenStackControlPlane resources are created when the status is "Setup complete".

    Tip
    Append the -w option to the end of the get command to track deployment progress.

What to do next