Chapter 4. Setting up the Environment
4.1. Preparing the Red Hat OpenShift Container Platform Cluster
- On the master or client, execute the following command to login as the cluster admin user:
# oc loginFor example:
oc login Authentication required for https://dhcp46-24.lab.eng.blr.redhat.com:8443 (openshift) Username: test Password: Login successful. You have access to the following projects and can switch between them with 'oc project <project_name>': default kube-system logging management-infra openshift openshift-infra * storage-project Using project "storage-project".
- On the master or client, execute the following command to create a project, which will contain all the containerized Red Hat Gluster Storage services:
# oc new-project <project_name>For example:
# oc new-project storage-project Now using project "storage-project" on server "https://master.example.com:8443"
- After the project is created, execute the following command on the master node to enable the deployment of the privileged containers as Red Hat Gluster Storage container can only run in the privileged mode.
# oadm policy add-scc-to-user privileged -z storage-project
- Execute the following steps on the master to set up the router:
NoteIf a router already exists, proceed to Step 5.
For more information regarding router setup, see https://access.redhat.com/documentation/en/openshift-container-platform/3.5/paged/installation-and-configuration/chapter-4-setting-up-a-router
- Execute the following command to enable the deployment of the router:
# oadm policy add-scc-to-user privileged -z router # oadm policy add-scc-to-user privileged -z default
- Execute the following command to deploy the router:
# oadm router storage-project-router --replicas=1
- Edit the subdomain name in the config.yaml file located at
- Restart the master OpenShift services by executing the following command:
# systemctl restart atomic-openshift-master
NoteIf the router setup fails, use the port forward method as described in Appendix C, Client Configuration using Port Forwarding .
- Execute the following command to verify if the router is running:
# oc get dc <router_name>For example:
# oc get dc storage-project-router NAME REVISION DESIRED CURRENT TRIGGERED BY storage-project-router 1 1 1 config
NoteEnsure you do not edit the
/etc/dnsmasq.conffile until the router has started.
- After the router is running, the client has to be setup to access the services in the OpenShift cluster. Execute the following steps on the client to set up the DNS.
For more information regarding setting up the DNS, see https://access.redhat.com/documentation/en/openshift-container-platform/3.5/single/installation-and-configuration/#envirornment-requirements.
- Edit the /etc/dnsmasq.conf file and add the following line to the file:
address=/.cloudapps.mystorage.com/<Router_IP_Address>where, Router_IP_Address is the IP address of the node where the router is running.
- Restart the
dnsmasqservice by executing the following command:
# systemctl restart dnsmasq
- Edit /etc/resolv.conf and add the following line: