OpenShift on CentOS 7 – Quick Installation

openshift-origin-logoThis is a quick guide to installing OpenShift Origin on a Cloud-A CentOS 7 instance. For the purposes of this tutorial, we are going to be using a single instance to perform an all-in-one installation. More advanced, clustered setup instructions can be found in the OpenShift Origin documentation.

What is OpenShift?

OpenShift is a Platform-as-a-Service (PaaS) developed by Redhat. PaaS augments your existing Cloud-A Infrastructure-as-a-Service (IaaS) by providing automated tools that assist developers in running an environment to host their applications on. In OpenShift’s case, this is provided by leveraging Docker and Kubernetes, giving you the ability to have custom, reusable application images. OpenShift also allows you to have highly available, self-healing, and auto-scaling applications without any of the manual setup that would typically need to be done in a traditional environment. 

Prerequisites

This guide assumes that you have setup a CentOS 7 instance on Cloud-A and have associated a public IP address with it. In our tutorial, we are using a 4GB General Purpose instance.

Once you have your instance up and running, Docker will need to be installed along with a few requirements. Feel free to replace vim with your favourite text editor.

$ sudo yum install docker wget vim

We will then need to tell Docker to trust the registry that we are going to be using for OpenShift images. In the /etc/sysconfig/docker file we will need to change the following line:

# INSECURE_REGISTRY='--insecure-registry'

to

INSECURE_REGISTRY='--insecure-registry 172.30.0.0/16'

Once complete, save your changes and restart the docker service:

$ sudo systemctl restart docker

OpenShift will also require that our instance’s hostname can be resolved. Adding an entry to /etc/hosts will take care of this for us. If you don’t know your instance’s hostname, you can simply run the hostname command.

Old /etc/hosts:

127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

New /etc/hosts:

127.0.0.1   <HOSTNAME> localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6

Read more