Chapter 3. Deploying Red Hat OpenShift Container Platform

With the prerequisites met, the focus shifts to the installation Red Hat OpenShift Container Platform. The installation and configuration is done via a series of Ansible playbooks and roles provided by the atomic-openshift packages.

Run the installer playbook to install Red Hat OpenShift Container Platform:

# ansible-playbook /usr/share/ansible/openshift-ansible/playbooks/deploy_cluster.yml

The playbooks runs through the complete process of installing Red Hat OpenShift Container Platform and reports a playbook recap showing the number of changes and errors (if any).

PLAY RECAP ********************************************************************************************************************************************************************************************************
ocp-app-1 : ok=233  changed=40   unreachable=0    failed=0
ocp-app-2 : ok=233  changed=40   unreachable=0    failed=0
ocp-app-3 : ok=233  changed=40   unreachable=0    failed=0
ocp-infra-1 : ok=233  changed=40   unreachable=0    failed=0
ocp-infra-2 : ok=233  changed=40   unreachable=0    failed=0
ocp-infra-3 : ok=233  changed=40   unreachable=0    failed=0
localhost   : ok=12   changed=0    unreachable=0    failed=0
ocp-master-1 : ok=674  changed=161  unreachable=0    failed=0
ocp-master-2 : ok=442  changed=103  unreachable=0    failed=0
ocp-master-3 : ok=442  changed=103  unreachable=0    failed=0

3.1. Storage class deployment

A Red Hat OpenShift Container Platform storageclass object is required for persistent storage for applications and logging if CNS is not deployed. A Red Hat OpenShift Container Platform deployment can have many storageclass objects but only one can be the default.

Create the yaml file defining the Microsoft Azure storage to be used.

# vi storageclass.yaml
kind: StorageClass
  name: standard
  annotations: "true"
  storageaccounttype: Standard_LRS
  kind: managed

Log into one of the master instances and use the oc client to create the default storageclass object.

# oc create -f storageclass.yaml

3.2. Logging

Return to the host that performed the deployment of OpenShift. Now that a persistent storage exists Red Hat OpenShift Container Platform logging can be deployed to store application container logs.

# vi /etc/ansible/hosts
openshift_logging_es_nodeselector={"region": "infra"}
openshift_logging_kibana_nodeselector={"region": "infra"}
openshift_logging_curator_nodeselector={"region": "infra"}

Run the Ansible playbook below to deploy the logging components.

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

3.3. Metrics

Red Hat OpenShift Container Platform metrics requires persistent storage. Modify the inventory to add in the variables for the installation of OpenShift metrics.

# vi /etc/ansible/hosts

Run the Ansible playbook below to deploy the metrics components.

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

3.4. Service Catalog

The service catalog also requires persistent storage to be used for an etcd pod that runs within the Red Hat OpenShift Container Platform project. Modify the inventory to change the value of openshift_enable_service_catalog from false to true.

# vi /etc/ansible/hosts

Run the Ansible playbook below to deploy the service catalog components.

# ansible-playbook /usr/share/ansible/openshift-ansible/playbooks/openshift-service-catalog/config.yml

3.5. Cloudforms Integration (Optional)

The steps defined below assume that Red Hat Cloudforms has been deployed and is accessible by the OpenShift environment.


To receive the most information about the deployed environment ensure that the OpenShift metrics components are deployed.

3.5.1. Requesting the Red Hat OpenShift Container Platform Management Token

The management token is used to allow for Cloudforms to retrieve information from the recently deployed OpenShift environment.

To request this token run the following command from a system with the oc client installed and from an account that has privileges to request the token from the management-infra namespace.

oc sa get-token -n management-infra management-admin

3.5.2. Adding OpenShift as a Containtainer Provider

Now that the token has been acquired, perform the following steps in the link below to add Red Hat OpenShift Container Platform to Red Hat Cloudforms.

3.5.3. Adding Microsoft Azure to Cloudforms

Red Hat Cloudforms also allows for not only the management of Red Hat OpenShift Container Platform but also for the management of Microsoft Azure. The link below contains the steps for adding Microsoft Azure to Cloudforms.