Appendix D. Deploying RHOCS storage for persistent storage

Note

The follow deployment steps are not supported by Red Hat and are provided as additional assistance.

To deploy a working vSphere OCS environment on the deployment host, first prepare it.

$ sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
$ sudo yum install -y python2-pyvmomi
$ git clone -b vmw-3.11 https://github.com/openshift/openshift-ansible-contrib
$ cd openshift-ansible-contrib/reference-architecture/vmware-ansible/

Next, make sure that the appropriate variables are assigned in the inventory file:

$ cat /etc/ansible/hosts
rhsub_user=rhn_username
rhsub_pass=rhn_password
rhsub_pool=8a85f9815e9b371b015e9b501d081d4b
[glusterfs]
storage-0  vm_name=storage-0 ipv4addr=10.x.y.33 glusterfs_zone=1 glusterfs_devices='[ "/dev/sdd" ]'
storage-1  vm_name=storage-1 ipv4addr=10.x.y.34 glusterfs_zone=2 glusterfs_devices='[ "/dev/sdd" ]'
storage-2  vm_name=storage-2 ipv4addr=10.x.y.35 glusterfs_zone=3 glusterfs_devices='[ "/dev/sdd" ]'
storage-3  vm_name=storage-3 ipv4addr=10.x.y.36 glusterfs_zone=4 glusterfs_devices='[ "/dev/sdd" ]'
[glusterfs_registry]
infra-0 glusterfs_zone=1 glusterfs_devices='[ "/dev/sdd" ]'
infra-1 glusterfs_zone=2 glusterfs_devices='[ "/dev/sdd" ]'
infra-2 glusterfs_zone=3 glusterfs_devices='[ "/dev/sdd" ]'
...omitted...
Note

For a downloadable copy of this inventory file please see the following repo

Note the storage group for the OCS nodes.

$ ansible-playbook playbooks/ocs-cv.yaml

During the Red Hat OpenShift Container Platform Installation, the following inventory variables are used to add Gluster OCS to the registry for persistent storage:

$ cat /etc/ansible/hosts
[OSEv3:children]
...omitted...
nodes
glusterfs
glusterfs_registry

[OSEv3:vars]
...omitted...
# registry
openshift_hosted_registry_storage_kind=glusterfs
openshift_hosted_registry_storage_volume_size=10Gi
openshift_hosted_registry_selector="node-role.kubernetes.io/infra=true"

# logging
openshift_logging_install_logging=true
openshift_logging_es_pvc_dynamic=true
openshift_logging_es_pvc_size=50Gi
openshift_logging_es_cluster_size=3
openshift_logging_es_pvc_storage_class_name='glusterfs-registry-block'
openshift_logging_kibana_nodeselector={"node-role.kubernetes.io/infra": "true"}
openshift_logging_curator_nodeselector={"node-role.kubernetes.io/infra": "true"}
openshift_logging_es_nodeselector={"node-role.kubernetes.io/infra": "true"}

# metrics
openshift_metrics_install_metrics=true
openshift_metrics_storage_kind=dynamic
openshift_metrics_storage_volume_size=20Gi
openshift_metrics_cassandra_pvc_storage_class_name='glusterfs-registry-block'
openshift_metrics_hawkular_nodeselector={"node-role.kubernetes.io/infra": "true"}
openshift_metrics_cassandra_nodeselector={"node-role.kubernetes.io/infra": "true"}
openshift_metrics_heapster_nodeselector={"node-role.kubernetes.io/infra": "true"}

# Container image to use for glusterfs pods
openshift_storage_glusterfs_image="registry.access.redhat.com/rhgs3/rhgs-server-rhel7:v3.11"

# Container image to use for gluster-block-provisioner pod
openshift_storage_glusterfs_block_image="registry.access.redhat.com/rhgs3/rhgs-gluster-block-prov-rhel7:v3.11"

# Container image to use for heketi pods
openshift_storage_glusterfs_heketi_image="registry.access.redhat.com/rhgs3/rhgs-volmanager-rhel7:v3.11"

# OCS storage cluster for applications
openshift_storage_glusterfs_namespace=app-storage
openshift_storage_glusterfs_storageclass=true
openshift_storage_glusterfs_storageclass_default=false
openshift_storage_glusterfs_block_deploy=false

# OCS storage cluster for OpenShift infrastructure
openshift_storage_glusterfs_registry_namespace=infra-storage
openshift_storage_glusterfs_registry_storageclass=false
openshift_storage_glusterfs_registry_block_deploy=true
openshift_storage_glusterfs_registry_block_host_vol_create=true
openshift_storage_glusterfs_registry_block_host_vol_size=200
openshift_storage_glusterfs_registry_block_storageclass=true
openshift_storage_glusterfs_registry_block_storageclass_default=false

[glusterfs]
storage-0.example.com glusterfs_zone=1 glusterfs_devices='[ "/dev/sdd" ]'
storage-1.example.com glusterfs_zone=2 glusterfs_devices='[ "/dev/sdd" ]'
storage-2.example.com glusterfs_zone=3 glusterfs_devices='[ "/dev/sdd" ]'
storage-3.example.com glusterfs_zone=1 glusterfs_devices='[ "/dev/sdd" ]'

[glusterfs_registry]
infra-0.example.com glusterfs_zone=1 glusterfs_devices='[ "/dev/sdd" ]'
infra-1.example.com glusterfs_zone=2 glusterfs_devices='[ "/dev/sdd" ]'
infra-2.example.com glusterfs_zone=3 glusterfs_devices='[ "/dev/sdd" ]'
...omitted...

Verify connectivity to the PVC for services:

[root@master-0 ~]# oc get pvc --all-namespaces
NAMESPACE           NAME                      STATUS    VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS               AGE
default             registry-claim            Bound     registry-volume                            25Gi       RWX                                       31d
logging             logging-es-0              Bound     pvc-22ee4dbf-48bf-11e8-b36e-005056b17236   10Gi       RWO            glusterfs-registry-block   8d
logging             logging-es-1              Bound     pvc-38495e2d-48bf-11e8-b36e-005056b17236   10Gi       RWO            glusterfs-registry-block   8d
logging             logging-es-2              Bound     pvc-5146dfb8-48bf-11e8-b871-0050568ed4f5   10Gi       RWO            glusterfs-registry-block   8d
mysql               mysql                     Bound     pvc-b8139d85-4735-11e8-b3c3-0050568ede15   10Gi       RWO            app-storage          10d
openshift-metrics   prometheus                Bound     pvc-1b376ff8-489d-11e8-b871-0050568ed4f5   100Gi      RWO            glusterfs-registry-block   8d
openshift-metrics   prometheus-alertbuffer    Bound     pvc-1c9c0ba1-489d-11e8-b871-0050568ed4f5   10Gi       RWO            glusterfs-registry-block   8d
openshift-metrics   prometheus-alertmanager   Bound     pvc-1be3bf3f-489d-11e8-b36e-005056b17236   10Gi       RWO            glusterfs-registry-block   8d