Installing OpenShift on AWS with User-Provisioned Infrastructure.
OpenShift is a popular container application platform that helps developers build, deploy, and manage applications at scale. One of the ways to install OpenShift is through the User Provisioned Infrastructure (UPI) method. In this method, you provide your own infrastructure, and OpenShift is installed on top of it. In this blog post, I will guide you through the steps of installing OpenShift using the UPI method.
Prerequisites
Before starting the installation process, ensure that you have the following in place:
- A supported infrastructure provider such as an EC2 instance on AWS and a registered domain.
- A Red Hat OpenShift Container Platform subscription.
Start out by creating your free amazon cloud account, if you already have one I would suggest creating a new one as you may incur charges after you prevision your cluster. You will need to immediately shut your cluster down to prevent charges. AWS helps hew customers get started for a free. Each calendar month, the amazon EC2 free tier allows you 750 hour per month of linux, RHEl, SUSE or Windows t2.micro or t3.micro instance depending on your region.
Request service quota increase
- Navigate to Service quota, aws services, amazon elastic compute cloud, search for L-1216C47A
- Request quota to 8.
Create a domain.
- Navigate over to Route53.
- Click registered domains in left panel of menu, then a register domain.
It may take a day or two for Amazon to register your domain. Two records are automatically crated NS and SOA, which is all we need for this tutorial.
Create an EC2 Instance.
- Navigate to EC2 instances, select lunch instance.
- give your instance a name
- Select the Amazon Linux image under Application and OS images
- Under instance type select t2.micro, usually pre selected.
- Under key pair select create new key pair, enter any name you want and select create key pair.
- Under Network settings select Edit in left panel, now at the bottom of Network settings select add Security Group, select type then choose HTTP, next select Source Type and select anywhere.
Create an IAM user and assign it to a user group with AdministrativeAccess and AmazonRoute53DomainsFullAccess.
- Navigate to IAM, select user groups, then create group.
- Under User group name, create a unique name, under attach permissions polices find AdministrativeAccess, clear the filter and find AmazonRoute53DomainsFullAccess.
- Next create a user, Select users, then add user, give it a name, click next and assign it to the user group you just created, select next and create user.
- Next create security credentials, go to users and click on the user you just created, find the Security Credentials tab, scroll down to Access Key and select create access keys, next select command line interface and click next. copy of the access key and secret. You can also down cvs file.
Configure AWS CLI
- Navigate back over to your instance, and login.
- Login as root user sudo su, run aws configure.
- enter the access key and secret
- select default region us-east-1, and output format as json.
Generate Key Pair for cluster node ssh Access.
- run ssh-keygen -t ed25519 -N ‘’-f ~/.ssh/id_rsa, to inspect the contents of this file run cat ~/.ssh/id_rsa.pub
Download the OCP installer and CLI
- log into the redhat console, click create cluster, select Cloud for the cluster type.
- Under run it yourself select AWS (x86_64) Full stack automation and pre-existing infrastructure.
- Select the Full Control UPI install type.
- Under Openshift installer choose the linux OS and right to copy the link address.
- Navigate to your EC2 instance, run mkdir downloads openshift, this will create two directories.
- cd into downloads and run wget <paste openshift installer>
- navigate to red hat console copy link to download cli, run wget <the openshift installer> in the downloads folder
- you should have two files openshift-install-linux.tar.gz and openshift-client-linux.tar.gz in the downloads folder, next un tar both files
- cp the installer into the OpenShift folder run # cp openshift-install /home/ec2-user/openshift. this will move the file from the downloads into the openshift you created.
- enable the cli, un tar the openshift-client file, run # cp oc /usr/local/bin you can do the same for kubectl
- insure the oc cli is enabled, run oc version.
- cd back into the openshift folder.
Run the installer
- in the open shift directory run pwd and copy the directory
- run # ./openshift-install create install-config — — dir=<directory you copied> in my case dir=/home/ec2-user/openshift.
- complete the question
- ssh pub key? select /root/.ssh/id_rsa.pub
- platform? aws
- region? us-east-2
- base domain? the domain you created
- cluster name? any name you want
- pull secret? copy pull secret from the red hat console
- open the install-config.yaml file, change the worker and master to 1 by default its set at 3.
- last run ./openshift-install create cluster — -dir=/home/ec2-use
Part Two loading