DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
Building Scalable Real-Time Apps with AstraDB and Vaadin
Register Now

Trending

  • Operator Overloading in Java
  • DevOps Midwest: A Community Event Full of DevSecOps Best Practices
  • What Is Istio Service Mesh?
  • Building A Log Analytics Solution 10 Times More Cost-Effective Than Elasticsearch

Trending

  • Operator Overloading in Java
  • DevOps Midwest: A Community Event Full of DevSecOps Best Practices
  • What Is Istio Service Mesh?
  • Building A Log Analytics Solution 10 Times More Cost-Effective Than Elasticsearch
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. Deployment
  4. OpenShift 3.11 Installation on a CentOS 7 Multi-Node Cluster

OpenShift 3.11 Installation on a CentOS 7 Multi-Node Cluster

Let's get container management with OpenShift configured and running on CentOS multi-node clusters.

Arun Sharma user avatar by
Arun Sharma
·
May. 15, 19 · Tutorial
Like (2)
Save
Tweet
Share
23.19K Views

Join the DZone community and get the full member experience.

Join For Free

OpenShift is a container management platform (PaaS) built around Docker containers orchestrated and managed by Kubernetes on a foundation of Red Hat Enterprise Linux

AWS CentOS instances are provisioned to do this setup, but it's not the only option. You can install OpenShift on-premises as well, but you need to ensure that you have internet access to those instances.

If you are trying to install OpenShift within an organization and servers are running behind a firewall/proxy server, you need to contact your network administrator to give internet access for this setup.

Prerequisites

Note: The following approach is not recommended in a production environment.

Provision the needed number of nodes of CentOS Linux. In this example, I created 3 CentOS nodes on AWS.

By default, you can't log in on AWS CentOS via 'root' user, so you need to make some changes to be able to login on CentOS with a 'root' user account.

To enable root access on an AWS CentOS instance, open /etc/ssh/sshd_config file and uncomment these settings in the file as given below:

# Login with centos user and run these commands.
$ sudo vi /etc/ssh/sshd_config
PermitRootLogin yes    #Uncomment this line in /etc/ssh/sshd_config and save it.

$ sudo systemctl restart sshd


Now copy the centos user's authorized_keys to root's authorized_keys.

$ sudo -s
$ cp /home/centos/.ssh/authorized_keys /root/.ssh/authorized_keys


Now you are ready to log in as a root user with the same private keys that you used for the centos user. Similarly, enable root access on each node that will be part of your OpenShift cluster.

The following ports are required to be opened for OpenShift clusters to establish communication among nodes.

Ports

Protocol

22

TCP

53 or 8053

TCP / UDP

80 or 443

TCP

1936

TCP

4001

TCP

2379 and 2380

TCP

4789

UDP

8443

TCP

10250

TCP


OpenShift Installation

There are multiple ways to install Openshift clusters, but I am going to use Ansible tools and a shell script to install Openshift 3.11 on my CentOS 7 instances.

To get more detail on ports for OpenShift, refer to this link.

Install git on the master node and clone the repository.

$ yum install -y git
$ git clone https://github.com/arunvdsharma/openshift-centos.git
$ cd openshift-centos


Note
: If there is an error related to "bad characters" while running any script command, execute the sed command to remove the bad characters, for example:

$ sed -i -e 's/\r$//' install-tools.sh


Update "Domain Name" in the Inventory File

You may want to configure a new domain name. If so, you can replace it. In my case, the domain name I used is aruntechhub.xyz, which I have procured on a DNS provider.

"There are multiple inventory files in the repository e.g. inventory-3nodes.ini. You can choose one, customize it according to your needs, and rename it with inventory.ini. The same inventory file will be used to install the OpenShift cluster."

Replace your domain name with the following properties in the inventory file:

openshift_public_hostname=console.your_domain_name
openshift_master_default_subdomain=apps.your_domain_name


Once you have made the necessary changes to your inventory.ini file, you are all set to install OpenShift. Don't forget to give executable permission to the install-tools.sh file, if it hasn't already been given. This file installs all the prerequisites to initiate OpenShift 3.11 installation on CentOS.

Note: Ensure that you are logged in via root user.

$ chmod +x install-tools.sh
$ ./install-tools.sh


Install Prerequisites on Other Nodes

Remember to perform the above steps on other cluster nodes and copy install-tools.sh from the master to te other nodes so you can run install prerequisites on every node.

#To ssh from one node to another using .pem file
$ scp -i keypair.pem install-tools.sh  root@host_ip:~/
$ ssh -i Openshift-keypair.pem root@host_ip
$ ./install-tools.sh


Once all the changes are done, you are all set to install OpenShift now. Run the following commands on the master node:

$ chmod +x install-openshift.sh
$ ./install-openshift.sh


If all the Ansible jobs are successful, you can access the OpenShift dashboard via https://console.your_domain_name.

Please provide your comments or suggestions, if any.

OpenShift Docker (software)

Opinions expressed by DZone contributors are their own.

Trending

  • Operator Overloading in Java
  • DevOps Midwest: A Community Event Full of DevSecOps Best Practices
  • What Is Istio Service Mesh?
  • Building A Log Analytics Solution 10 Times More Cost-Effective Than Elasticsearch

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com

Let's be friends: