Software and Systems How-To's, Tutorials, Demos, Notes

How to Install OpenShift Origin in one node in AWS for Development Purposes

Assumptions:

Add the following entry to the security group named “CentOS 7 (x86_64) - with Updates HVM…”

## Install oc client

```bash
curl -L https://github.com/openshift/origin/releases/download/v1.5.1/openshift-origin-client-tools-v1.5.1-7b451fc-linux-64bit.tar.gz -o oc.tar.gz
tar -xzvf oc.tar.gz 
mv openshift-origin-client-tools-v1.5.1-7b451fc-linux-64bit/oc /usr/local/bin/

Add /usr/local/bin to root’s PATH. Edit /root/.bashrc and add the following line:

export PATH=$PATH:/usr/local/bin

Source the file /root/.bashrc

source /root/.bashrc

Install Firewalld if not already installed

yum install -y firewalld

Install git if not already installed

yum install -y git

Install docker

yum install -y docker
INSECURE_REGISTRY='--insecure-registry 172.30.0.0/16'
systemctl restart docker

Configure firewalld

[root@openshift sysconfig]# docker network inspect -f "" bridge

172.17.0.0/16
firewall-cmd --permanent --new-zone dockerc
firewall-cmd --permanent --zone dockerc --add-source 172.17.0.0/16
firewall-cmd --permanent --zone dockerc --add-port 53/udp
firewall-cmd --permanent --zone dockerc --add-port 8053/udp
firewall-cmd --reload
firewall-cmd --permanent --zone public --add-port 8443/tcp
firewall-cmd --permanent --zone public --add-port 80/tcp
firewall-cmd --permanent --zone public --add-port 443/tcp
firewall-cmd --permanent --zone public --add-port 10250/tcp
firewall-cmd --reload

Install OpenShift

sudo mkdir -p /var/lib/origin/openshift.local.data

*Important: Substitute your ip address when you see *

[root@openshift sysconfig]# oc cluster up \
--public-hostname=<elastic ip> --routing-suffix=<elastic ip>.nip.io \
--host-data-dir=/var/lib/origin/openshift.local.data \
--metrics=true
-- Checking OpenShift client ... OK
-- Checking Docker client ... OK
-- Checking Docker version ... OK
-- Checking for existing OpenShift container ... 
   Deleted existing OpenShift container
-- Checking for openshift/origin:v1.5.1 image ... OK
-- Checking Docker daemon configuration ... OK
-- Checking for available ports ... OK
-- Checking type of volume mount ... 
   Using nsenter mounter for OpenShift volumes
-- Creating host directories ... OK
-- Finding server IP ... 
   Using <elastic ip> as the server IP
-- Starting OpenShift container ... 
   Creating initial OpenShift configuration
   Starting OpenShift using container 'origin'
   Waiting for API server to start listening
   OpenShift server started
-- Adding default OAuthClient redirect URIs ... OK
-- Installing registry ... OK
-- Installing router ... OK
-- Installing metrics ... OK
-- Importing image streams ... OK
-- Importing templates ... OK
-- Login to server ... OK
-- Creating initial project "myproject" ... OK
-- Removing temporary directory ... OK
-- Checking container networking ... OK
-- Server Information ... 
   OpenShift server started.
   The server is accessible via web console at:
       https://<elastic ip>:8443

   The metrics service is available at:
       https://metrics-openshift-infra.<elastic ip>.xip.io

   You are logged in as:
       User:     developer
       Password: developer

   To login as administrator:
       oc login -u system:admin
oc adm policy add-cluster-role-to-user cluster-admin admin
username: admin
password: admin

You should be able to see this:

Congratulations! OpenShift Origin is up and running!