Chapter 4. Setting up the Environment
This chapter outlines the details for setting up the environment for Red Hat Gluster Storage Container Converged in OpenShift.
4.1. Preparing the Red Hat OpenShift Enterprise Cluster
Execute the following steps to prepare the Red Hat OpenShift Enterprise cluster:
- On the client, execute the following command to login as the cluster admin user:
# oc login
For example:# oc login Authentication required for https://master.example.com:8443 (openshift) Username: <cluster-admin-user> Password: <password> Login successful. You have access to the following projects and can switch between them with 'oc project <projectname>': * default (current) * management-infra * openshift * openshift-infra Using project "default".
- 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"
- Execute the following steps to set up the router:
Note
If a router already exists, proceed to Step 5.- Execute the following command on the client that is used to deploy Red Hat Gluster Storage Container Converged with OpenShift:
# 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 /etc/origin/master/master-config.yaml .For example:
subdomain: "cloudapps.mystorage.com”
- Restart the master OpenShift services by executing the following command:
# systemctl restart atomic-openshift-master
Note
If the router setup fails, use the port forward method as described in Appendix B, Client Configuration using Port Forwarding
For more information regarding router setup, see https://access.redhat.com/documentation/en/openshift-enterprise/3.2/single/installation-and-configuration/#install-config-install-deploy-router - After the router is running, the clients have to be setup to access the services in the OpenShift cluster. Execute the following steps to set up the DNS.
- On the client, 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 one of the nodes running the router.Note
Ensure you do not edit the /etc/dnsmasq.conf file until the router has started. - Restart the
dnsmasq
service by executing the following command:# systemctl restart dnsmasq
- Edit /etc/resolv.conf and add the following line:
nameserver 127.0.0.1
For more information regarding setting up the DNS, see https://access.redhat.com/documentation/en/openshift-enterprise/version-3.2/installation-and-configuration/#prereq-dns. - After the project is created, execute the following command on the master node to deploy the privileged containers:
# oadm policy add-scc-to-user privileged -z default
Note
Red Hat Gluster Storage container can only run in privileged mode.