How to Install own OPENSHIFT cluster !

Spread the love

Spread the love

Spread the love

How to Install own OPENSHIFT cluster !

Drop your queries for installation at support@openshiftwiki.com or comment below.

 

Today, we will learn how to install your own openshift cluster on your laptop or personal computer, it is recommended that machine should have at-least

8Gb of Ram as current version of openshift runs number of default pods to perform it’s functionality.

 

  1. Install and configure oracle virtual box or other hypervisor to your machine.
  2. Download and install Centos or RHEL linux Operating system.
  3. Once your machine is ready, make sure your os able to ping/access internet correctly.

 

Let’s assume, you have created only 1 vm and want to install openshift on a single node (for testing purpose)

So, now fist thing you need to configure your linux os’s hostname, for example : hostnamectl set-hostname master.openshift.com.

Note: In this post, we are going to install open-source version of openshift, we called it OKD.

1. Install the required software/RPM for openshift :

# yum install wget git net-tools bind-utils yum-utils iptables-services bridge-utils bash-completion kexec-tools sos psacct

2. Update operating system with

# yum update -y

3. Reboot the vm / os , from oracle virtual box (hypervisor).

4. Install EPEL Repository :

# yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

5. Disable the EPEL repository globally so that it is not accidentally used during later steps of the installation:

# sed -i -e “s/^enabled=1/enabled=0/” /etc/yum.repos.d/epel.repo

6. Install the packages for Ansible : # yum -y –enablerepo=epel install ansible pyOpenSSL

7. clone the openshift/openshift-ansible repository from GitHub, it will provide the actual sensible playbooks, which will be used in the installation of openshift.
# cd ~
# git clone https://github.com/openshift/openshift-ansible
# cd openshift-ansible
# git checkout release-3.11

8. Install docker, which will be served as runtime for container images.

# yum install docker-1.13.1

9. Restart and enable docker

# systemctl enable docker
# systemctl start docker
# systemctl is-active docker

10. Edit the /etc/sysconfig/docker and replace the option like with below

” OPTIONS=’–insecure-registry=172.30.0.0/16 –selinux-enabled –log-opt max-size=1M –log-opt max-file=3′ “

11. Restart docker service via : #systemctl restart docker

12. Prepare your inventory file ( which will be used as your configuration file for installing openshift cluster )

========================================================================
SAMPLE INVENTORY 192.168.0.0 need to be replace with your vm’s IP .xip.io
======================================================================== [OSEv3:children] masters nodes etcd [OSEv3:vars] ansible_ssh_user=root ansible_become=true openshift_deployment_type=origin openshift_disable_check=memory_availability,disk_availability,docker_image_availability,docker_storage openshift_master_default_subdomain=192.168.0.0.xip.io openshift_master_cluster_method=native openshift_master_cluster_hostname=master.openshift.com ansible_service_broker_install=False openshift_enable_service_catalog=false openshift_master_identity_providers=[{‘name’: ‘htpasswd_auth’, ‘login’: ‘true’, ‘challenge’: ‘true’, ‘kind’: ‘HTPasswdPasswordIdentityProvider’} [masters] master.openshift.com [etcd] master.openshift.com [nodes] master.openshift.com openshift_node_group_name=’node-config-master’, openshift_node_group_name=’node-config-compute’, openshift_node_group_name=’node-config-infra’

 

13. Go to directory in your vm : openshift/openshift-ansible

14.  Run the below command to start the installer,

#ansible-playbook -i /etc/ansible/hosts /root/openshift-ansible/playbooks/prerequisites.yml –ask-pass –ask-sudo-pass -vvv   (Enter your root credentials twice to proceed)

#ansible-playbook -i /etc/ansible/hosts /root/openshift-ansible/playbooks/deploy_cluster.yml –ask-pass –ask-sudo-pass -vvv (Enter your root credentials twice to proceed)

 

Post installation your openshift should be available like below :

 

[root@master ~]# oc get pods –all-namespaces NAMESPACE               NAME                                           READY     STATUS    RESTARTS   AGE default                 docker-registry-1-9vw5z                        1/1       Running   3          11d default                 registry-console-1-xkhk5                       1/1       Running   3          11d default                 router-1-8wmfw                                 1/1       Running   3          11d kube-system             master-api-master.openshift.com                1/1       Running   4          11d kube-system             master-controllers-master.openshift.com        1/1       Running   3          11d kube-system             master-etcd-master.openshift.com               1/1       Running   3          11d openshift-console       console-856db74d8f-pb9sh                       1/1       Running   3          11d openshift-monitoring    alertmanager-main-0                            3/3       Running   9          11d openshift-monitoring    alertmanager-main-1                            3/3       Running   9          11d openshift-monitoring    alertmanager-main-2                            3/3       Running   9          11d openshift-monitoring    cluster-monitoring-operator-6465f8fbc7-98xnn   1/1       Running   3          11d openshift-monitoring    grafana-6b9f85786f-jlgrw                       2/2       Running   6          11d openshift-monitoring    kube-state-metrics-7449d589bc-lfmf8            3/3       Running   9          11d openshift-monitoring    node-exporter-vv979                            2/2       Running   6          11d openshift-monitoring    prometheus-k8s-0                               4/4       Running   13         11d openshift-monitoring    prometheus-k8s-1                               4/4       Running   13         11d openshift-monitoring    prometheus-operator-6644b8cd54-dxr59           1/1       Running   3          11d openshift-node          sync-hg5mf                                     1/1       Running   3          11d openshift-sdn           ovs-b8dvk                                      1/1       Running   3          11d openshift-sdn           sdn-lmgnx                                      1/1       Running   3          11d openshift-web-console   webconsole-7df4f9f689-9jkdm                    1/1       Running   0          13s [root@master ~]# oc get nodes NAME                   STATUS    ROLES                  AGE       VERSION master.openshift.com   Ready     compute,infra,master   11d       v1.11.0+d4cacc0 [root@master ~]#

4 thoughts on “How to Install own OPENSHIFT cluster !

  1. There is sample inventory file given just next to step 12, you need to take it’s reference and replace the values as per your master information like :

    192.168.0.0 = your master machine’s IP
    Configure your machine’s hostname and point them to :
    Master.openshift.com.

    After that follow step 13 & 14.

    Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *

Archives

Share !

Social menu is not set. You need to create menu and assign it to Social Menu on Menu Settings.