This Quick Start reference deployment guide provides step-by-step instructions for deploying Red Hat OpenShift on the Amazon Web Services (AWS) cloud.
We will look at the OpenShift v3.x was created to reflect the additional information needed based on some key models below Docker, Kubernetes.
- DNS: The host that contain Red Hat OpenShift control components, including the API server and the controller manager server. The master manages nodes in its Kubernetes
- Master: The host that contain Red Hat OpenShift control components, including the API server and the controller manager server. The master manages nodes in its Kubernetes cluster and schedules pods to run on nodes.
- Hub: The host that contain Red Hat OpenShift registry, router and NFS. This server some people call as Infra Server. This server is important, we will point our wild card DNS “cloudapps.cloud-cafe.in” in godaddy.in in my domain configuration.
- Node1 and Node2: Nodes provide the runtime environments for containers. Each node in a Kubernetes cluster has the required services to be managed by the master. Nodes also have the required services to run pods, including Docker, a kubelet and a service proxy.
image
Before you deploy this Quick Start, we recommend that you become familiar with the following AWS services. (If you are new to AWS, see Getting Started with AWS.)
- Amazon Virtual Private Cloud (Amazon VPC)
- Amazon Elastic Compute Cloud (Amazon EC2)
It is assumes that familiarity with PaaS concepts and Red Hat OpenShift. For more information, see the Red Hat OpenShift documentation. If you want to access publically your openshift then you need registered domain. Here I use my domain (cloud-café.in) which I purchase from godaddy.in
- Configure VPC with 10.90.0.0/16 CIDR (Do not use 10.1.0.0/16 or 10.128.0.0/14, this CIDR by default taken by OpenShift for internal communication), But there is option if you want to change, see the Red Hat OpenShift documentation.
- Create two subnet (Private - 10.90.2.0/24 & Public 10.90.1.0/24)
- Create InternetGateWay (IGW)
- Create routing table for internet and associate public subnet and add route with Internet Gate Way
- Setup NatGateWay and assign public IP and select Public Subnet
- Then add route 0.0.0.0/0 source from NAT
- Then go to association and add Private Subnet.
** OSE-DNS-SG **
Type | Protocol | Port Range | Source |
---|---|---|---|
HTTP | TCP | 80 | 0.0.0.0/0 |
SSH | TCP | 22 | 0.0.0.0/0 |
Custom TCP | TCP | 8443 | 10.90.0.0/16 |
DNS (UDP) | UDP | 53 | 10.90.0.0/16 |
DNS (TCP) | TCP | 53 | 10.90.0.0/16 |
HTTPS | TCP | 443 | 0.0.0.0/0 |
All ICMP | All | N/A | 10.90.0.0/16 |
** OSE-MASTER-SG **
Type | Protocol | Port Range | Source |
---|---|---|---|
Custom UDP | UDP | 10250 | 10.90.0.0/16 |
HTTP | TCP | 80 | 0.0.0.0/0 |
Custom TCP | TCP | 4789 | 10.90.0.0/16 |
SSH | TCP | 22 | OSE-DNS-SG |
Custom TCP | TCP | 8443 | 0.0.0.0/0 |
Custom UDP | UDP | 2049 | 10.90.0.0/16 |
Custom TCP | TCP | 10250 | 10.90.0.0/16 |
DNS (UDP) | UDP | 53 | 10.90.0.0/16 |
DNS (TCP) | TCP | 53 | 10.90.0.0/16 |
Custom UDP | UDP | 4789 | 10.90.0.0/16 |
HTTPS | TCP | 443 | 0.0.0.0/0 |
All ICMP | All | N/A | 10.90.0.0/16 |
NFS | TCP | 2049 | 10.90.0.0/16 |
** OSE-HUB-SG **
Type | Protocol | Port Range | Source |
---|---|---|---|
Custom UDP | UDP | 10250 | 10.90.0.0/16 |
HTTP | TCP | 80 | 0.0.0.0/0 |
Custom TCP | TCP | 4789 | 10.90.0.0/16 |
SSH | TCP | 22 | OSE-DNS-SG |
Custom TCP | TCP | 8443 | 10.90.0.0/16 |
Custom UDP | UDP | 2049 | 10.90.0.0/16 |
Custom TCP | TCP | 10250 | 10.90.0.0/16 |
DNS (UDP) | UDP | 53 | 10.90.0.0/16 |
DNS (TCP) | TCP | 53 | 10.90.0.0/16 |
Custom UDP | UDP | 4789 | 10.90.0.0/16 |
HTTPS | TCP | 443 | 0.0.0.0/0 |
All ICMP | All | N/A | 10.90.0.0/16 |
NFS | TCP | 2049 | 10.90.0.0/16 |
** OSE-NODE-SG **
Type | Protocol | Port Range | Source |
---|---|---|---|
Custom UDP | UDP | 10250 | 10.90.0.0/16 |
HTTP | TCP | 80 | 0.0.0.0/0 |
Custom TCP | TCP | 4789 | 10.90.0.0/16 |
SSH | TCP | 22 | OSE-DNS-SG |
Custom TCP | TCP | 8443 | 10.90.0.0/16 |
Custom UDP | UDP | 2049 | 10.90.0.0/16 |
Custom TCP | TCP | 10250 | 10.90.0.0/16 |
DNS (UDP) | UDP | 53 | 10.90.0.0/16 |
DNS (TCP) | TCP | 53 | 10.90.0.0/16 |
Custom UDP | UDP | 4789 | 10.90.0.0/16 |
HTTPS | TCP | 443 | 0.0.0.0/0 |
All ICMP | All | N/A | 10.90.0.0/16 |
NFS | TCP | 2049 | 10.90.0.0/16 |
DNS is a requirement for OpenShift Enterprise. In fact most issues comes if you do not have properly working DNS environment. As we are running in AWS so there is another complex because AWS use its own DNS server on their instances, we need to change make a separate DNS server and use in our environment.
- Go to your VPC
- Choose your VPC from “Filter by VPC:”
- Click “DHCP Option Sets”
- Create DHCP Option Set
- Give your domain name “cloud-café-in” in Domain name
- Give DNS server IP in Domain name servers.
- You can set NTP servers on same DNS server, give DNS server IP in NTP servers (optional).
- Now go to your VPC
- Choose your VPC from “Filter by VPC:”
- Click “Your VPCs”
- Select Openshift-VPC
- Click Action
- Then “Edit DHCP Option Set “
- Then Select what you created from earlier.
Add below content in user data in Advance section.
#!/bin/bash
echo nameserver 8.8.8.8 >> /etc/resolv.conf
yum install git unzip -y
Once DNS host is up and running, login on that dns host and make ready dns host for staring installation
git clone https://github.com/prasenforu/openshift-aws.git
cd openshift-aws
chmod 400 prasen.pem
chmod 755 *.sh
./setup-dns.sh
reboot dns host
Add access-key, secret-access-key & region in this file.
./install-aws-cli.sh
Host | Private IP | Public IP | Security Group | Subnet |
---|---|---|---|---|
ose-master | 10.90.1.208 | Yes | OSE-MASTER-SG | Public |
ose-hub | 10.90.1.209 | Yes | OSE-HUB-SG | Public |
ose-node1 | 10.90.2.210 | No | OSE-NODE-SG | Private |
ose-node2 | 10.90.2.211 | No | OSE-NODE-SG | Private |
You Can change script based on your requirement.
(Type of host, volume size, etc.)
./instance-creation.sh
### Note: Before running this script make sure you add your key-pair content in prasen.pem file
./next-step1.sh
./install-docker-storage.sh
./start-ose-installation.sh
Login authentication using htpassword, edit this file as per your requirement.
### Note: This script need to run from ose-master host
ssh ose-master
./post-ose-setup.sh
oc get pods
oc get all
url=`more /etc/origin/master/master-config.yaml | grep publicURL`
echo $url
docker rm `docker ps -a | grep -v CONTAINER | grep Exited | awk '{print $1}'`
rm ~/.aws/config install-aws-cli.sh prasen.pem
We'll love to hear feedback and ideas on how we can make it more useful. Just create an issue.
Thanks !!