System Requirements:
A. Red Hat Subscriptions:
You must have an active OpenShift Container Platform subscription on your Red Hat account to proceed.
B. Minimum Hardware Requirements:
For Master:
- 2 Physical or virtual system.
- Base OS: RHEL 7.3 or 7.4 with the “Minimal” installation.
- 2 vCPU. (You can use 1 CPU for testing Environment.)
- Minimum 16GB RAM. (You can use 4 GB for testing Environment.)
- 20 GB of minimum disk size for the testing environment.
- One 20GB of extra hard-disk attached to the master node.
For Nodes:
- 2 Physical or virtual system.
- Base OS: RHEL 7.3 or 7.4 with the “Minimal” installation.
- 1 vCPU, Minimum 8 GB RAM. (You can use 2 GB for testing Environment.)
- 20 GB of minimum disk size for the testing environment.
- One 20GB of extra hard-disk attached to the node.
SELinux should be enforcing and targeted mode.
Host File:
Host file should like below on both the machines.
# vi /etc/hosts
10.160.0.2 master.syshunt.com master
10.160.0.3 node1.syshunt.com node1
HostName:
Edit hosts files,
# vi /etc/hostname
Master.syshunt.com
For Node:
# vi /etc/hostname
node1.syshunt.com
Red Hat subscription:
Register both the machines with your Red Hat subscription:
subscription-manager register
Take a pool id of below,30 Day Self-Supported Red Hat OpenShift Container Platform, 2-Core Evaluation30 Day Red Hat Enterprise Linux Server Self-Supported Evaluation
subscription-manager attach --pool=8a85f98c601232d90160125e9c28041
subscription-manager attach --pool=8a85f98c600b1aeb01600b48068608f3
subscription-manager repos --enable="rhel-7-server-rpms" \
--enable="rhel-7-server-extras-rpms" \
--enable="rhel-7-server-ose-3.6-rpms" \
--enable="rhel-7-fast-datapath-rpms"
Then do system update:
yum repolist
yum update
After update reboot both of your machine.
reboot
DNS:
Edit your both the machines resolv.conf and entry should look like below,
vi /etc/resolv.conf
search syshunt.com
nameserver 127.0.0.1
Install dnsmasq and bind-utils on both the machines,
yum install dnsmasq bind-utils -y
Edit the /etc/
vi /etc/dnsmasq.conf
address=/ocp.master.syshunt.com/10.160.0.2
resolv-file=/etc/resolv.dnsmasq
create /etc/resolv.dnsmasq file in both the machines and make entry like below,
vi /etc/resolv.dnsmasq
8.8.8.8
Enable and restart
systemctl restart dnsmasq && systemctl enable dnsmasq
Firewalld:
Disable and stop firewalld on both the machines,
systemctl stop firewalld && systemctl disable firewalld
Installing Docker:
You should install Docker 1.12.6 on all master and node hosts.
yum install docker-1.12.6 -y
Configuring Docker Storage:
Configure dedicated partition or hard disk on both the machines in my case it is sdb.
vi /etc/sysconfig/docker-storage-setup
DEVS=sdb
VG=docker-vg
Then run docker-storage-setup and review the output to ensure the docker-pool volume was created:
docker-storage-setup
Start and enable docker on both the machines,
systemctl enable docker && systemctl start docker
Ensuring Host Access:
The quick and advanced installation methods require a user that has access to all hosts. If you want to run the installer as a non-root user, passwordless sudo rights must be configured on each destination host.
For example, you can generate an SSH key on the host where you will invoke the installation process:
ssh-keygen
Quick Installation of OpenShift:
Install following packages on both the machines.
yum install atomic-openshift-docker-excluder atomic-openshift-utils bridge-utils git iptables-services net-tools wget -y
Running an Interactive Installation:
Run below command on master to start installation process,
atomic-openshift-installer install
Are you ready to continue? [y/N]: y
User for ssh access [root]: root (or your sudo user)
(1) OpenShift Container Platform
(2) Registry
Choose a variant from above: [1]: 1
Enter hostname or IP address: master.syshunt.com
Will this host be an OpenShift master? [y/N]: y
Will this host be RPM or Container based (rpm/container)? [rpm]: rpm
Do you want to add additional hosts? [y/N]: y
Enter hostname or IP address: node1.syshunt.com
Will this host be an OpenShift master? [y/N]: n
Will this host be RPM or Container based (rpm/container)? [rpm]: rpm
Do you want to add additional hosts? [y/N]: n
(Optional)
If you want to override the cluster hostname
Enter hostname or IP address [None]:
Setting up high-availability masters requires a storage host. Please provide a
host that will be configured as a Registry Storage.
Note: Containerized storage hosts are not currently supported.
Enter hostname or IP address [master.syshunt.com]:
You might want to override the default subdomain used for exposed routes. If you don't know what this is, use the default value.
New default subdomain (ENTER for none) []: ocp.master.example.com
If a proxy is needed to reach HTTP and HTTPS traffic, please enter the
name below. This proxy will be configured by default for all processes
that need to reach systems outside the cluster. An example proxy value
would be:
http://proxy.example.com:8080/
More advanced configuration is possible if using Ansible directly:
https://docs.openshift.com/enterprise/latest/install_config/http_proxies.html
Specify your http proxy ? (ENTER for none) []:
If a proxy is needed to reach HTTP and HTTPS traffic, please enter the
name below. This proxy will be configured by default for all processes
that need to reach systems outside the cluster. An example proxy value
would be:
http://proxy.example.com:8080/
Specify your http proxy ? (ENTER for none) []:
Specify your https proxy ? (ENTER for none) []:
master.syshunt.com,10.10.0.2,37.200.24.210,openshift-master-1,37.200.24.210
node1.syshunt.com,10.10.0.3,37.200.22.91,instance-1,37.200.22.91
Format:
connect_to,IP,public IP,hostname,public hostname
Notes:
* The installation host is the hostname from the installer's perspective.
* The IP of the host should be the internal IP of the instance.
* The public IP should be the externally accessible IP associated with the instance
* The hostname should resolve to the internal IP from the instances
themselves.
* The public hostname should resolve to the external IP from hosts outside of
the cloud.
Do the above facts look correct? [y/N]: y
Wrote atomic-openshift-installer config: /root/.config/openshift/installer.cfg.yml
Wrote Ansible inventory: /root/.config/openshift/hosts
Ready to run installation process.
If changes are needed please edit installer.cfg.yml config file above and re-run.
Are you ready to continue? [y/N]: y
Note: It will take more than 30 minutes depending upon your internet speed and hosts resources,
After the installation completes:
root@master ~]# oc get pod --all-namespaces
NAMESPACE NAME READY STATUS RESTARTS AGE
default docker-registry-1-5d5ck 1/1 Running 0 2d
default registry-console-1-4pzgn 1/1 Running 0 2d
default router-1-ktsnk 1/1 Running 0 2d
What’s Next
- Now that you have a working OpenShift Container Platform instance, you can:
- Configure authentication by default, authentication is set to Deny All.
- Configure the automatically-deployed integrated Docker registry.
- Configure the automatically-deployed router.