Skip to content

casimon-rh/ocp-vsphere-customip-install

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Openshift Container Platform -> VMWare VSphere Custom IP Install Playbooks

Intro

Based on the Installer User Provided Infraestructure (UPI) repo for VMWare, and following the Blog Post it install a minimal, parametrizable cluster with role based resource and naming and automatic kernel parametrization.

Environment 🌲

The following playbooks and scripts were tested on the following versions for this technologies:

Content 🍱

Terraform 🌎

Role based resource distribution of metal-like installation over VSphere. Runs on terraform 0.12 with the following variables (terraform.tfvars)

  • vsphere_server
  • vsphere_user
  • vsphere_password
  • vsphere_cluster
  • vsphere_folder
  • vsphere_datacenter
  • vsphere_datastore
  • vsphere_guest_id
  • vsphere_iso_path
  • vm_network
  • cluster_id
  • vm_prefix
  • info

It creates the number of machines specified in the variables as well as naming them (customizable**) with specific resources per node-role.

Default specifications:

Count Role CPU RAM Disk(s) Prefix Ip
1 Bootstrap 4 8Gi 1x60Gb boots 2
3 Master 4 8Gi 1x60Gb ctrl 3
2 Application 4 8Gi 1x60Gb app 4

Steps:🚶‍♂️

vi terraform.tfvars # custom vars
terraform init
terraform plan # optional
terraform apply -auto-approve

Selenium 🤖

Automatic bot for setting of network-specific kernel params of RHCOS, for openshift installation. The params that need to be sent are:

  • ip
  • nameserver
  • coreos.inst.install_dev
  • coreos.inst.image_url
  • coreos.inst.ignition_url

The bot builds the string and sends it char by char. The following parameters are required:

Short Flag Long Flag Description
-w --webdriver-dir Webdriver Folder
-s --vsphere-url VMWare VSphere URL
-u --username VMWare VSphere user
-p --password VMWare Vsphere password
-g --gateway IP Gateway
-d --dns DNS Server
-m --mask Network Mask
-n --network-interface Default Network Interface
-b --base-url FQDN base url
-i --image-url Install Image URL
-l --ignition-url Install Ignition Base URL
-f --servers-file Servers csv file

It also needs a csv file describing the created vms with the following headers:

  • Virtual Machine Name
  • FQDN name
  • IP
  • Ignition file name (per initial role)
ocp_boots1_2,boots1,192.168.0.2,append-bootstrap.ign
ocp_ctr1_3,ctr1,192.168.0.3,master.ign
ocp_ctr2_4,ctr2,192.168.0.4,master.ign
ocp_ctr3_5,ctr3,192.168.0.5,master.ign
ocp_app1_6,app1,192.168.0.6,worker.ign
ocp_app2_7,app2,192.168.0.7,worker.ign
ocp_app3_9,app3,192.168.0.9,worker.ign

Steps: 🚶‍♂️

wget https://github.com/mozilla/geckodriver/releases/download/v0.**.0/geckodriver-v0.**.0-platform.tar.gz # check latest version and platform
virtualenv -p /usr/bin/python3 local-venv
pip install -r requirements.txt
vi servers.csv # customize servers
python main.py -h # check params
python main.py #...

Pre-requisites ✅

As described in the UPI Installation Guide, the default settings cover the minimal resource requirements of compute. You need to provision externally the load balancers and the dns requirements. As well as prepare the ignition scripts with the openshift-install binary and expose them on a http server cluster-wide available.

Improvements "To be done" 📝

  1. Terraform: loop/dynamic module loading per node role
  2. Terraform: custom naming function?
  3. Terraform: different datastore for iso?
  4. Selenium: search for folder name instead of choosing first
  5. Selenium: lambda/one loop for string build and operations
  6. Selenium: check if webconsole is the default choice in vsphere

Best with 💫

VSCode 🎀