Appendix D. Deploying CNS and a CNS inventory file

To deploy a working vSphere CNS 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.9 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
[storage]
cns-0  openshift_node_labels="{'region': 'infra'}" ipv4addr=10.x.y.33
cns-1  openshift_node_labels="{'region': 'infra'}" ipv4addr=10.x.y.34
cns-2  openshift_node_labels="{'region': 'infra'}" ipv4addr=10.x.y.35
...omitted...

Note the storage group for the CNS nodes.

$ ansible-playbook playbooks/cns-storage.yaml

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

$ cat /etc/ansible/hosts
...omitted...
# CNS registry storage
openshift_hosted_registry_storage_kind=glusterfs
openshift_hosted_registry_storage_volume_size=30Gi

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

# CNS storage 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_storageclass=true
openshift_storage_glusterfs_registry_block_storageclass_default=false
openshift_storage_glusterfs_registry_block_host_vol_create=true
openshift_storage_glusterfs_registry_block_host_vol_size=100
# 100% Dependent on sizing for logging and metrics

[glusterfs]
cns-0  glusterfs_devices='[ "/dev/sdd" ]'
cns-1  glusterfs_devices='[ "/dev/sdd" ]'
cns-2  glusterfs_devices='[ "/dev/sdd" ]'
[glusterfs_registry]
infra-0  glusterfs_devices='[ "/dev/sdd" ]'
infra-1  glusterfs_devices='[ "/dev/sdd" ]'
infra-2  glusterfs_devices='[ "/dev/sdd" ]'
...omitted...

After the installation has been completed, metrics can be added via the following process.

$ cat /etc/ansible/hosts
...omitted...
# metrics
openshift_metrics_install_metrics=true
openshift_metrics_hawkular_nodeselector={"role":"infra"}
openshift_metrics_cassandra_nodeselector={"role":"infra"}
openshift_metrics_heapster_nodeselector={"role":"infra"}
openshift_metrics_cassanda_pvc_storage_class_name="glusterfs-registry-block"
openshift_metrics_cassandra_pvc_size=25Gi
openshift_metrics_storage_kind=dynamic
...omitted...

$ ansible-playbook /usr/share/ansible/openshift-ansible/playbooks/openshift-metrics/config.yml

Finally, logging is configured:

$ cat /etc/ansible/hosts
...omitted...
# logging
openshift_logging_install_logging=true
openshift_logging_es_cluster_size=3
openshift_logging_es_nodeselector={"role":"infra"}
openshift_logging_kibana_nodeselector={"role":"infra"}
openshift_logging_curator_nodeselector={"role":"infra"}
openshift_logging_es_pvc_storage_class_name="glusterfs-registry-block"
openshift_logging_es_pvc_size=10Gi
openshift_logging_storage_kind=dynamic

$ ansible-playbook /usr/share/ansible/openshift-ansible/playbooks/openshift-logging/config.yml

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            glusterfs-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