Chapter 2. Deploy using dynamic storage devices
Deploying OpenShift Container Storage on OpenShift Container Platform using dynamic storage devices provided by VMware vSphere (disk format: thin) provides you with the option to create internal cluster resources. This will result in the internal provisioning of the base services, which helps to make additional storage classes available to applications.
Both internal and external Openshift Container Storage clusters are supported on VMware vSphere. See Planning your deployment for more information about deployment requirements.
Also, ensure that you have addressed the requirements in Preparing to deploy OpenShift Container Storage chapter before proceeding with the below steps for deploying using dynamic storage devices:
2.1. 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.
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
- Log in to OpenShift Web Console.
-
Click Operators
OperatorHub. - Search for OpenShift Container Storage from the list of operators and click on it.
- Click Install.
Set the following options on the Install Operator page:
- Channel as stable-4.8.
- Installation Mode as A specific namespace on the cluster.
-
Installed Namespace as Operator recommended namespace openshift-storage. If Namespace
openshift-storage
does not exist, it will be created during the operator installation. - Approval Strategy as Automatic or Manual.
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.2. 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.2.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" } }'
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" } }'
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.3. Creating an OpenShift Container Storage Cluster Service in internal mode
Use this procedure to create an OpenShift Container Storage Cluster Service after you install the OpenShift Container Storage operator.
Prerequisites
- The OpenShift Container Storage operator must be installed from the Operator Hub. For more information, see Installing OpenShift Container Storage Operator using the Operator Hub.
-
For VMs on VMware, ensure the
disk.EnableUUID
option is set toTRUE
. You need to have vCenter account privileges to configure the VMs. For more information, see Required vCenter account privileges. To set thedisk.EnableUUID
option, use the Advanced option of the VM Options in the Customize hardware tab. For more information, see Creating Red Hat Enterprise Linux CoreOS (RHCOS) machines in vSphere. -
(Optional) If you want to use thick-provisioned storage for flexibility, you must create a storage class with
zeroedthick
oreagerzeroedthick
disk format. For information, see VMware vSphere object definition. - If you want to use the technology preview feature of multus support, before deployment you must create network attachment definitions (NADs) that later will be attached to the cluster. For more information, see Multi network plug-in (Multus) support and Creating network attachment definitions.
Procedure
- Log into the OpenShift Web Console.
Click Operators
Installed Operators to view all the installed operators. Ensure that the Project selected is
openshift-storage
.- Click OpenShift Container Storage > Create Instance link of Storage Cluster.
-
Select Mode is set to
Internal
by default. Select Capacity and nodes
Select Storage Class.
By default, it is set to
thin
. If you have created a storage class withzeroedthick
oreagerzeroedthick
disk format for thick-provisioned storage, then that storage class is listed in addition to the default,thin
storage class.Select Requested Capacity from the drop down list. It is set to
2 TiB
by default. You can use the drop down to modify the capacity value.NoteOnce you select the initial storage capacity, cluster expansion is performed only using the selected usable capacity (3 times of raw storage).
In the Select Nodes section, select at least three available nodes.
Spread the worker nodes across three different physical nodes, racks or failure domains for high availability.
Use vCenter anti-affinity to align OpenShift Container Storage rack labels with physical nodes and racks in the data center to avoid scheduling two worker nodes on the same physical chassis.
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 will be deployed. For minimum starting node requirements, see Resource requirements section in Planning guide.
- Click Next.
(Optional) Set Security and network configuration
- Select the Enable encryption checkbox to encrypt block and file storage.
Choose 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.
Select the Connect to an external key management service checkbox. This is optional for cluster-wide encryption.
-
Key Management Service Provider is set to
Vault
by default. - Enter Vault Service Name, host Address of Vault server ('https://<hostname or ip>'), Port number and Token.
Expand Advanced Settings to enter additional settings and certificate details based on your Vault configuration:
- Enter the Key Value secret path in Backend Path that is dedicated and unique to OpenShift Container Storage.
- (Optional) Enter TLS Server Name and Vault Enterprise Namespace.
- Provide CA Certificate, Client Certificate and Client Private Key by uploading the respective PEM encoded certificate file.
- Click Save.
-
Key Management Service Provider is set to
Select Default (SDN) if you are using a single network or Custom (Multus) Network if you plan on using multiple network interfaces.
- Select a Public Network Interface from drop down.
Select a Cluster Network Interface from drop down.
NoteIf only using one additional network interface select the single NetworkAttachementDefinition (i.e. ocs-public-cluster) for the Public Network Interface and leave the Cluster Network Interface blank.
- Click Next.
- Review the configuration details. To modify any configuration settings, click Back to go back to the previous configuration page.
- Click Create.
Edit the configmap if Vault Key/Value (KV) secret engine API, version 2 is used for cluster-wide encryption with Key Management System (KMS).
-
On the OpenShift Web Console, navigate to Workloads
ConfigMaps. - To view the KMS connection details, click ocs-kms-connection-details.
Edit the configmap.
-
Click Action menu (⋮)
Edit ConfigMap. Set the
VAULT_BACKEND
parameter tov2
.kind: ConfigMap apiVersion: v1 metadata: name: ocs-kms-connection-details [...] data: KMS_PROVIDER: vault KMS_SERVICE_NAME: vault [...] VAULT_BACKEND: v2 [...]
- Click Save.
-
Click Action menu (⋮)
-
On the OpenShift Web Console, navigate to Workloads
Verification steps
- On the storage cluster details page, the storage cluster name displays a green tick next to it to indicate that the cluster was created successfully.
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.
-
Click Operators
- To verify that all components for OpenShift Container Storage are successfully installed, see Verifying your OpenShift Container Storage installation.
- To verify the multi network plug-in (Multus), see Verifying the Multus plug-in.