Search

Chapter 2. Deploying OpenShift Container Storage using local storage devices

download PDF

To deploy OpenShift Container Storage using local storage devices on a bare metal infrastructure, follow the below sections:

2.1. Installing Local Storage Operator

You can install the Local Storage Operator using the Red Hat OpenShift Container Platform Operator Hub.

Prerequisite

  • Access to an OpenShift Container Platform cluster using an account with cluster-admin and Operator installation permissions.

Procedure

  1. Log in to the OpenShift Web Console.
  2. Click Operators OperatorHub.
  3. Type local storage in the Filter by keyword…​ box to search for Local Storage operator from the list of operators and click on it.
  4. Click Install.
  5. Set the following options on the Install Operator page:

    1. Channel as stable-4.8.
    2. Installation Mode as A specific namespace on the cluster.
    3. Installed Namespace as Operator recommended namespace openshift-local-storage.
    4. Approval Strategy as Automatic.
  6. Click Install.

Verification step

  • Verify that the Local Storage Operator shows the Status as Succeeded.

2.2. Installing Red Hat OpenShift Container Storage Operator

You can install Red Hat OpenShift Container Storage Operator using the Red Hat OpenShift Container Platform Operator Hub.

Prerequisites

  • Access to an OpenShift Container Platform cluster using an account with cluster-admin and operator installation permissions.
  • You have at least three worker nodes in the Red Hat OpenShift Container Platform cluster.
  • You have satisfied any additional requirements required. For more information, see Planning your deployment.
Note
  • When you need to override the cluster-wide default node selector for OpenShift Container Storage, you can use the following command to specify a blank node selector for the openshift-storage namespace (create openshift-storage namespace in this case):

    $ oc annotate namespace openshift-storage openshift.io/node-selector=
  • Taint a node as infra to ensure only Red Hat OpenShift Container Storage resources are scheduled on that node. This helps you save on subscription costs. For more information, see How to use dedicated worker nodes for Red Hat OpenShift Container Storage chapter in Managing and Allocating Storage Resources guide.

Procedure

  1. Log in to OpenShift Web Console.
  2. Click Operators OperatorHub.
  3. Search for OpenShift Container Storage from the list of operators and click on it.
  4. Click Install.
  5. Set the following options on the Install Operator page:

    1. Channel as stable-4.8.
    2. Installation Mode as A specific namespace on the cluster.
    3. Installed Namespace as Operator recommended namespace openshift-storage. If Namespace openshift-storage does not exist, it will be created during the operator installation.
    4. Approval Strategy as Automatic or Manual.
    5. Click Install.

      If you select Automatic updates, the Operator Lifecycle Manager (OLM) automatically upgrades the running instance of your operator without any intervention.

      If you select Manual updates, the OLM creates an update request. As a cluster administrator, you must then manually approve that update request to have the operator updated to the new version.

Verification step

  • Verify that the OpenShift Container Storage Operator shows a green tick indicating successful installation.

2.3. Creating Multus networks

OpenShift Container Platform uses the Multus CNI plug-in to allow chaining of CNI plug-ins. During cluster installation, you can configure your default pod network. The default network handles all ordinary network traffic for the cluster. You can define an additional network based on the available CNI plug-ins and attach one or more of these networks to your pods. To attach additional network interfaces to a pod, you must create configurations that define how the interfaces are attached. You can specify each interface by using a NetworkAttachmentDefinition custom resource (CR). A CNI configuration inside each of the NetworkAttachmentDefinition defines how that interface is created.

OpenShift Container Storage uses the CNI plug-in called macvlan. Creating a macvlan-based additional network allows pods on a host to communicate with other hosts and pods on those hosts by using a physical network interface. Each pod that is attached to a macvlan-based additional network is provided a unique MAC address.

2.3.1. Creating network attachment definitions

To utilize Multus, an already working cluster with the correct networking configuration is required. For more information, see Recommended network configuration and requirements for a Multus configuration. The NetworkAttachmentDefinition (NAD) created now is later available to be selected during the storage cluster installation. This is the reason they must be created before the storage cluster.

As detailed in the Planning Guide, the Multus networks you create depend on the number of available network interfaces you have for OpenShift Container Storage traffic. It is possible to separate all of the storage traffic onto one of two interfaces (one interface used for default OpenShift SDN) or to further segregate storage traffic into client storage traffic (public) and storage replication traffic (private or cluster).

The following is an example NetworkAttachmentDefinition for all storage traffic, public and cluster, on the same interface. It requires one additional interface on all schedulable nodes (OpenShift default SDN on separate network interface).

apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: ocs-public-cluster
  namespace: openshift-storage
spec:
  config: '{
  	"cniVersion": "0.3.1",
  	"type": "macvlan",
  	"master": "ens2",
  	"mode": "bridge",
  	"ipam": {
    	    "type": "whereabouts",
    	    "range": "192.168.1.0/24"
  	}
  }'
Note

All network interface names must be the same on all nodes attached to Multus network (that is, ens2 for ocs-public-cluster).

The following is an example NetworkAttachmentDefinitions for storage traffic on separate Multus networks, public for client storage traffic and cluster for replication traffic. It requires two additional interfaces on OpenShift nodes hosting OSD pods and one additional interface on all other schedulable nodes (OpenShift default SDN on separate network interface).

apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: ocs-public
  namespace: openshift-storage
spec:
  config: '{
  	"cniVersion": "0.3.1",
  	"type": "macvlan",
  	"master": "ens2",
  	"mode": "bridge",
  	"ipam": {
    	    "type": "whereabouts",
    	    "range": "192.168.1.0/24"
  	}
  }'

Example NetworkAttachmentDefinition:

apiVersion: "k8s.cni.cncf.io/v1"
kind: NetworkAttachmentDefinition
metadata:
  name: ocs-cluster
  namespace: openshift-storage
spec:
  config: '{
  	"cniVersion": "0.3.1",
  	"type": "macvlan",
  	"master": "ens3",
  	"mode": "bridge",
  	"ipam": {
    	    "type": "whereabouts",
    	    "range": "192.168.2.0/24"
  	}
  }'
Note

All network interface names must be the same on all nodes attached to Multus networks (that is, ens2 for ocs-public and ens3 for ocs-cluster).

2.4. Creating OpenShift Container Storage cluster on bare metal

Prerequisites

Procedure

  1. Log into the OpenShift Web Console.
  2. Click Operators Installed Operators to view all the installed operators.
  3. Ensure that the Project selected is openshift-storage.
  4. Click OpenShift Container Storage Create Instance link of Storage Cluster.
  5. Select mode as Internal-Attached devices.

    You are prompted to install the Local Storage Operator if it is not already installed. Click Install and follow the procedure described in Installing Local Storage Operator.

    You can create a dedicated storage class to consume storage by filtering set of storage volumes.

  6. Discover disks by using one of the following options:

    • All nodes to discover disks in all the nodes.
    • Select nodes to discover disks from a subset of available nodes.

      Important

      For using arbiter mode, do not select the All nodes option. Instead, use the Select nodes option to select the labeled nodes with attached storage devices from the two data-center zones.

      If the nodes to be selected are tainted and not discovered in the wizard, follow the steps in the Red Hat Knowledgebase Solution as a workaround to add tolerations for Local Storage Operator resources.

      If the nodes selected do not match the OpenShift Container Storage cluster requirement of an aggregated 30 CPUs and 72 GiB of RAM, a minimal cluster is deployed. For minimum starting node requirements, see Resource requirements section in the Planning guide.

  7. Click Next.
  8. Create Storage class

    1. Enter the Local Volume Set Name.
    2. Enter the Storage Class Name. By default, the volume set name appears for the storage class name. You can also change the name.
    3. The nodes selected for disk discovery in the previous step are displayed in the Filter Disks By section.

      Select one of the following:

      • Disks on all nodes to select all the nodes for which you discovered the devices.
      • Disks on selected nodes to select a subset of the nodes for which you discovered the devices. Spread the worker nodes across three different physical nodes, racks or failure domains for high availability.

        Important

        The flexible scaling feature gets enabled on creating a storage cluster with 3 or more nodes spread across fewer than the minimum requirement of 3 availability zones. This feature is available only for the new deployments of OpenShift Container Storage 4.7 clusters and does not support the upgraded clusters. For information about flexible scaling, see Scaling Storage Guide

    4. From the available list of Disk Type, select SSD/NVMe.
    5. Expand the Advanced section and set the following options:

      Volume Mode

      Block is selected by default.

      Device Type

      Select disk types. By default, Disk and Part are selected.

      Disk Size

      Minimum and maximum available size of the device that needs to be included.

      Note

      You must set a minimum size of 100GB for the device.

      Maximum Disk Limit

      This indicates the maximum number of PVs that can be created on a node. If this field is left empty, then PVs are created for all the available disks on the matching nodes.

    6. Click Next. A pop-up to confirm creation of the new storage class is displayed.
    7. Click Yes to continue.
  9. Set Capacity and nodes

    1. Select Storage Class. By default, the new storage class created in the previous step is selected.

      • Selected Nodes shows the nodes selected in the previous step. This list takes a few minutes to reflect the disks that were discovered in the previous step.
    2. Click Next.
  10. Optional: Set Security and network configuration.

    1. Select the Enable encryption checkbox to encrypt block and file storage.
    2. Select any one or both Encryption level:

      • Cluster-wide encryption to encrypt the entire cluster (block and file).
      • Storage class encryption to create encrypted persistent volume (block only) using encryption enabled storage class.
    3. Select the Connect to an external key management service checkbox. This is optional for cluster-wide encryption.

      1. Key Management Service Provider is set to Vault by default.
      2. Enter Vault Service Name, host Address of Vault server (https://<hostname or ip>), Port number and Token.
      3. Expand Advanced Settings to enter additional settings and certificate details based on your Vault configuration:

        1. Enter the Key Value secret path in the Backend Path that is dedicated and unique to OpenShift Container Storage.
        2. Optional: Enter TLS Server Name and Vault Enterprise Namespace.
        3. Provide CA Certificate, Client Certificate and Client Private Key by uploading the respective PEM encoded certificate file.
        4. Click Save.
  11. Select Default (SDN) if you are using a single network or Custom (Multus) Network if you plan on using multiple network interfaces.

    1. Select a Public Network Interface from drop down.
    2. Select a Cluster Network Interface from drop down.

      Note

      If you are using only one additional network interface, select the single NetworkAttachementDefinition (for example, ocs-public-cluster) for the Public Network Interface and leave the Cluster Network Interface blank.

  12. Click Next.
  13. Review the configuration details. To modify any configuration settings, click Back and you are redirected to the previous configuration page.
  14. Click Create.
  15. Edit the configmap if Vault Key/Value (KV) secret engine API, version 2 is used for cluster-wide encryption with Key Management System (KMS).

    1. On the OpenShift Web Console, click Workloads ConfigMaps.
    2. To view the KMS connection details, click ocs-kms-connection-details.
    3. Edit the configmap.

      1. Click Action menu (⋮) Edit ConfigMap.
      2. Set the VAULT_BACKEND parameter to v2.

        kind: ConfigMap
        apiVersion: v1
        metadata:
          name: ocs-kms-connection-details
        [...]
        data:
          KMS_PROVIDER: vault
          KMS_SERVICE_NAME: vault
        [...]
          VAULT_BACKEND: v2
        [...]
      3. Click Save.

Verification steps

  • To verify that the final Status of the installed storage cluster shows as Phase: Ready with a green tick mark.

    • Click Operators Installed Operators Storage Cluster link to view the storage cluster installation status.
    • Alternatively, when you are on the Operator Details tab, you can click on the Storage Cluster tab to view the status.
  • To verify if flexible scaling is enabled on your storage cluster, perform the following steps (for arbiter mode, flexible scaling is disabled):

    1. Click ocs-storagecluster in the Storage Cluster tab.
    2. In the YAML tab, search for the keys flexibleScaling in spec section and failureDomain in status section. If flexible scaling is true and failureDomain is set to host, the flexible scaling feature is enabled.

      spec:
      flexibleScaling: true
      […]
      status:
      failureDomain: host
  • To verify that all components for OpenShift Container Storage are successfully installed, see Verifying your OpenShift Container Storage installation.
  • To verify that OpenShift Container Storage is successfully installed, see Verifying your OpenShift Container Storage installation.

Additional resources

  • To expand the capacity of the initial cluster, see the Scaling Storage guide.
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.