How to setup Openshift on AWS Without Minishift or CRC

RAJNISH MISHRA
4 min readMar 12, 2021

OKD is a distribution of Kubernetes optimized for continuous application development and multi-tenant deployment. OKD adds developer and operations-centric tools on top of Kubernetes to enable rapid application development, easy deployment and scaling, and long-term lifecycle maintenance for small and large teams. OKD is a sibling Kubernetes distribution to Red Hat OpenShift.

In simple words, OKD is upstream of Openshift. I won’t get into much detail what OKD or Openshift is. You can find that in my other article.

Installing Openshift in local device requires a lot of compute unit and generally we don’t have that much resources. So, the best option is to deploy it on cloud. It costs very little or no money (If you have Credits).

If you follow the official Documentation of Openshift to deploy on cloud, you may get struck in between as it requires Route 53 service. So, in this article we will understand how we can deploy it on cloud without much hassle. Let’s start.

Prerequisites

  • I have used CentOS 7 (x86_64) — with Updates HVM as my AMI. I tried using other AMI’s also but there was some issue in Docker version. So, I would recommend to use this version.
  • Select t2.medium (2 CPU and 8GiB Memory). Atleast this much resources should be there for smooth operation.
  • Provide atleast 20GiB storage.
  • Configure Security Group properly/
  • Launch the instance
  • If you can provide Elastic IP to your instance then it will be very good as after every reboot you have to change IP and DNS

Configuration

We have to run multiple commands.

#!/bin/bash
echo "Enter the public ec2 hostname: "
read hostname
echo "Enter the public ip of ec2 or the eip attached to the instance: "
read ip
yum install docker vim wget -y
echo "********************************************DISABLING SELINUX**********************************************"
setenforce 0
systemctl start docker
echo "***********************************DOWNLOADING OPENSHIFT v3.6.0 ALPHA VERSION******************************************************"
wget https://github.com/openshift/origin/releases/download/v3.6.0-alpha.0/openshift-origin-client-tools-v3.6.0-alpha.0-0343989-linux-64bit.tar.gz
tar -xzf openshift-origin-client-tools-v3.6.0-alpha.0-0343989-linux-64bit.tar.gz
cp openshift-origin-client-tools-v3.6.0-alpha.0-0343989-linux-64bit/oc /usr/local/bin/
echo OPTIONS="--default-ulimit nofile=1024:4096 --insecure-registry 172.30.0.0/16" >> /etc/sysconfig/docker
systemctl restart docker
echo "****************************************STARTING OKDv3.6.0 CLUSTER*****************************************"
oc cluster up --routing-suffix=$ip.nip.io --public-hostname=$hostname

As we need to run multiple command, so you can make a script and then run the script.

vi script.sh          #copy the above commandschmod +x script.sh    #to make the file executable./script.sh           #to run the script

After running the script you just have to provide the Public IPv4 DNS and Public IP of your Instance.

After the script runs successfully, you will get URL to connect to Openshift. You will also get your Username as developer and Password also as developer.

Now when you go to the URL. You may see this screen.

There’s nothing to worry about. Click on advanced and the proceed to url.

Now you just have to login and proceed.

I hope the article was able to solve your manual configuration issues. Mr. Raghav Gupta helped a lot to deploy this on cloud. Special Thanks to him. If you have any feedback or suggestion, you can comment below.

You can appreciate the article by giving it a like and posting comments about your feedback here or on LinkedIn.

--

--