OpenShift 3.9 Installation Vagrant Virtual-Box

Description:

OKD (Origin Community Distribution of Kubernetes) is the new name for OpenShift Origin, the Origin Community Distribution of Kubernetes that powers Red Hat OpenShift.

The installation of OKD take some time, as you have to create the virtual machines, prepare the virtual machines for the installation, generate the inventory of the OKD… This little projet help you to create everything as fast as your laptop will be able to do it.

It will be a laboratory, in VirtualBox, three master node, one infraestructure node, one applitation node, and one load balancer node. Why 3 master? Well, it will allow you to experiment with the core of OpenShift as a cluster of three nodes.

Git Project:

https://github.com/felix-centenera/OKD_CentOS7.5/tree/okdtenera/OKD_CentOS7.5/tree/okd3.9_CentOS7.53.9_CentOS7.5

Tested A:

  • VirtualBox 5.2.18
  • Vagrant version: Installed Version: 2.0.4
  • Vagrant plugins:
    • vagrant-hostmanager (1.8.9)
  • Vagrant box list:
    • centos/7 (virtualbox, 1809.01)

Tested B:

  • VirtualBox 6.1 (15 Dec 2019: Last Virtual Box Version is not already ready for Vagrant, 5 min to fixed, follow the steps from this URL: https://github.com/oracle/vagrant-boxes/issues/178)
  • Vagrant version: Installed Version: 2.2.6
  • Vagrant plugins:
    • vagrant-hostmanager (1.8.9)
  • Vagrant box list:
    • centos/7 (virtualbox, 1905.1)

Infrastructure:

  • 3 master nodes.
    • master-one (Bastion node)
    • master-two
    • master-three & CNS Node
  • 1 infra node.
    • infra-one & CNS Node
  • 1 app node.
    • app-one & CNS Node
  • 1 lb (HA proxy) node
    • lb-one

CNS (Container Native Storage) as Storage solution.

Details:

  • User Virtual Machine:
    • user: root
    • password: vagrant
    • user: vagrant
    • password: vagrant
    • Openshift admin user:
      • user: admin
      • password: r3dh4t1!

Start the project:

 

Download the project:

git clone https://github.com/felix-centenera/OKD_CentOS7.5.git

Customize the disks paths:

A part of the disks for OS in every virtual machine, we will need to create a disk for docker in all the machines of the cluster, and we will create three disks for CNS (Container Native Storage). By default all the disk will be created in the next path, $HOME/VirtualBox.  If you want to change the path, just edit Vagrantfile with your custom Path.

Generate VirtualBox Machines with Vagrant:

This process will create all the virtual machines for you.

cd OKD3.9_CentOS7.5/vagrant/

vagrant up

 

Login in the bastion:

 vagrant ssh masterone 

 

Prepare the bastion node:

su root

ansible-playbook -i /root/ansible/inventories/bastion /root/ansible/playbooks/bastion.yml

 

Prepare the rest of the nodes for OKD 3.9:

ansible-playbook -i /root/ansible/inventories/ocp /root/ansible/playbooks/preparation.yml

 

Check prerequisites of the nodes for OKD 3.9:

ansible-playbook -i /root/ansible/inventories/ocp /root/release-3.9/playbooks/prerequisites.yml

 

Install OKD 3.9:

ansible-playbook -i /root/ansible/inventories/ocp /root/release-3.9/playbooks/deploy_cluster.yml

 

Post installation OKD 3.9:

ansible-playbook -i /root/ansible/inventories/ocp /root/ansible/playbooks/postinstallation.yml

 

Prepare OKD 3.9:

oc login -u system:admin -n default

oc adm policy add-cluster-role-to-user cluster-admin admin

oc patch storageclass glusterfs-storage -p '{"metadata": {"annotations": {"storageclass.kubernetes.io/is-default-class": "true"}}}'

 

Start using OKD 3.9: