OpenShift on vSphere Automation Scripts
Deploy OCP on vSphere with these utilities.
- Login to, or create, the OCP admin system (i.e. a RHEL/CentOS 7/8 VM)
- Pull the mminichino/ansible-playbooks repository into $HOME/playbooks
- Create OCP directory in $HOME/ocp
- Pull the mminichino/openshift-automation repository into $HOME/ocp/bin
- Create $HOME/OpenShift_install-config.yaml per OCP documentation
- Create ${HOME}/append-bootstrap.ign per OCP documentation
- Create $HOME/pull-secret/pull-secret.json with your pull secrets
- Mount the HTTP path for bootstrap.ign as /install
- Create OCP folder in vSphere
- Deploy RHCOS templates for bootstrap, master, and worker nodes into OCP folder
- Add Configuration Parameter guestinfo.ignition.config.data.encoding and set it to base64
- Add Configuration Parameter disk.EnableUUID and set it to TRUE
- Create $HOME/playbooks/group_vars/all/vault.yaml with vsphere_address, vsphere_username and vsphere_password
- Add ocp_vsphere_folder, ocp_vsphere_vm_folder, vsphere_datacenter, oslab_datastore, and esx2_host (ocp_vsphere_folder and ocp_vsphere_vm_folder are the same in this example) to vault.yaml
- Create oslab_host_list with the bootstrap, master, and worker nodes with name, mac, and template name attributes in vault.yaml
- Create an appropriate $HOME/playbooks/.vault_password
- Configure DHCP statuc mappings for bootstrap, master, and worker hosts and Load Balancer VIPs and Pools for master and worker nodes
- Optionally if you will use a mirror registry, run set-ocp-registry-environment.sh to do the inital setup of the mirror registry
- In $HOME/ocp run bin/prepOpenShift.sh
- When the cluster is up run bin/approve-csr-reqs.sh to complete the install
- Optionally if you use a mirror OCP registry, use the fix-pull-secret.sh, fix-sample-registry.sh, mirror-oper-catalog.sh, and mirror-trident.sh scripts to update the mirror registry
- Optionally you can use storagegrid-image-registry.sh to configure OCP to use StorageGRID for the Image Registry
$ cd ocp
$ bin/prepOpenShift.sh
$ bin/approve-csr-reqs.sh
Example oslab_host_list construct:
oslab_host_list:
- name: bootstrap-0
mac: 00:50:xx:xx:xx:xx
template: RHCOS-bootstrap
- name: master-0
mac: 00:50:xx:xx:xx:xx
template: RHCOS-master
- name: worker-0
mac: 00:50:xx:xx:xx:xx
template: RHCOS-worker