Chapter 1. Deploying OpenShift Container Storage on OpenShift Container Platform
The deployment process consists of two main parts:
- Install the OpenShift Container Storage Operator by following the instructions in Section 1.1, “Installing Red Hat OpenShift Container Storage Operator using the Operator Hub”.
- Create the OpenShift Container Storage service by following the instructions in Section 1.2, “Creating an OpenShift Container Storage service”.
-
When you install OpenShift Container Storage in a restricted network environment, you need to apply a custom Network Time Protocol (NTP) configuration to the nodes, because by default, internet connectivity is assumed in OpenShift Container Platform and
chronyd
is configured to use*.rhel.pool.ntp.org
servers. See Red Hat Knowledgebase article and Configuring chrony time service for more details. PodDisruptionBudget
alert, which is an OpenShift Container Platform alert, will start to appear for object storage devices (OSDs) after the deployment. You can ignore this alert. Also, you can silence this alert by following the instructions in Managing cluster alerts section of the Openshift Container Platform documentation. For instructions on how to do so, see the Managing cluster alerts sections of the Red Hat Openshift Container Platform documentation.For more information, see Red Hat Knowledgebase article.
For Red Hat Enterprise Linux based hosts in a user provisioned infrastructure (UPI), you need to enable container access to the underlying file system by following the instructions in Section 1.3, “Enabling file system access for containers on Red Hat Enterprise Linux based nodes”.
1.1. Installing Red Hat OpenShift Container Storage Operator using the Operator Hub
You can install Red Hat OpenShift Container Storage using the Red Hat OpenShift Container Platform Operator Hub on Amazon Web Services (AWS) and VMware vSphere platforms. For information about the hardware and software requirements, see Planning your deployment guide.
Prerequisites
- Log in to OpenShift Container Platform cluster.
- You must have at least three worker nodes in the OpenShift Container Platform cluster.
You must create a namespace called
openshift-storage
as follows:- Click Administration → Namespaces in the left pane of the OpenShift Web Console.
- Click Create Namespace.
-
In the Create Namespace dialog box, enter
openshift-storage
for Name andopenshift.io/cluster-monitoring=true
for Labels. This label is required to get the dashboards. - Select No restrictions option for Default Network Policy.
- Click Create.
When you need to override the cluster-wide default node selector for OpenShift Container Storage, you can use the following command in command line interface to specify a blank node selector for the openshift-storage
namespace:
$ oc annotate namespace openshift-storage openshift.io/node-selector=
Procedure
- Click Operators → OperatorHub in the left pane of the OpenShift Web Console.
Click on OpenShift Container Storage.
You can use the Filter by keyword text box or the filter list to search for OpenShift Container Storage from the list of operators.
- On the OpenShift Container Storage operator page, click Install.
On the Install Operator page, ensure the following options are selected:
- Update Channel as stable-4.4
- Installation Mode as A specific namespace on the cluster.
-
Installed Namespace as Operator recommended namespace PR openshift-storage. If Namespace
openshift-storage
does not exist, it will be created during the operator installation. Select Approval Strategy as Automatic or Manual. Approval Strategy is set to Automatic by default.
Approval Strategy as Automatic.
NoteWhen you select the Approval Strategy as Automatic, approval is not required either during fresh installation or when updating to the latest version of OpenShift Container Storage.
- Click Install
- Wait for the install to initiate. This may take up to 20 minutes.
- Click Operators → Installed Operators
-
Ensure the Project is
openshift-storage
. By default, the Project isopenshift-storage
. - Wait for the Status of OpenShift Container Storage to change to Succeeded.
Approval Strategy as Manual.
NoteWhen you select the Approval Strategy as Manual, approval is required during fresh installation or when updating to the latest version of OpenShift Container Storage.
- Click Install
- On the Installed Operators page, click ocs-operator.
- On the Subscription Details page, click the Install Plan link.
- On the InstallPlan Details page, click Preview Install Plan
- Review the install plan and click Approve.
- Wait for the Status of the Components to change from Unknown to either Created or Present.
- Click Operators → Installed Operators
-
Ensure the Project is
openshift-storage
. By default, the Project isopenshift-storage
. - Wait for the Status of OpenShift Container Storage to change to Succeeded.
Verification steps
-
Verify that OpenShift Container Storage Operator show the Status as
Succeeded
.
1.2. Creating an OpenShift Container Storage service
You need to create a new OpenShift Container Storage service after you install OpenShift Container Storage operator.
Prerequisites
- OpenShift Container Storage operator must be installed from the Operator Hub. For more information, see Installing OpenShift Container Storage Operator using the Operator Hub.
Procedure
- Click Operators → Installed Operators from the left pane of the OpenShift Web Console to view the installed operators.
- On the Installed Operator page, select openshift-storage from the Project drop down list to switch to the openshift-storage project.
Click OpenShift Container Storage operator.
OpenShift Container Storage operator creates a OCSInitialization resource automatically.
On the OpenShift Container Storage operator page, scroll right and click the Storage Cluster tab.
Figure 1.1. OpenShift Container Storage Operator page
On the OCS Cluster Services page, click Create OCS Cluster Service.
Figure 1.2. Create New OCS Service page
On the Create New OCS Service page, perform the following:
- Select at least three worker nodes from the available list of nodes for the use of OpenShift Container Storage service. Ensure that the nodes are in different Location.
Storage Class is set by default depending on the platform.
gp2
is the default storage class for AWS andthin
is the default storage class for VMware.Select OCS Service Capacity from the drop down list.
NoteOnce you select the initial storage capacity here, you can add more capacity only in this increment.
Click Create.
The Create button is enabled only after you select three nodes. A new storage cluster of three volumes will be created with one volume per worker node. The default configuration uses a replication factor of 3.
Verification steps
- To verify that OpenShift Container Storage is successfully installed, see Verifying OpenShift Container Storage deployment.
1.3. Enabling file system access for containers on Red Hat Enterprise Linux based nodes
Deploying OpenShift Container Platform on a Red Hat Enterprise Linux base in a user provisioned infrastructure (UPI) does not automatically provide container access to the underlying Ceph file system.
This process is not necessary for hosts based on Red Hat Enterprise Linux CoreOS.
Procedure
Perform the following steps on each node in your cluster.
- Log in to the Red Hat Enterprise Linux based node and open a terminal.
Verify that the node has access to the rhel-7-server-extras-rpms repository.
# subscription-manager repos --list-enabled | grep rhel-7-server
If you do not see both
rhel-7-server-rpms
andrhel-7-server-extras-rpms
in the output, or if there is no output, run the following commands to enable each repository.# subscription-manager repos --enable=rhel-7-server-rpms # subscription-manager repos --enable=rhel-7-server-extras-rpms
Install the required packages.
# yum install -y policycoreutils container-selinux
Persistently enable container use of the Ceph file system in SELinux.
# setsebool -P container_use_cephfs on
- Verify that containers can now access OpenShift Container Storage hosted on this node.