Automate OpenShift 4 UPI deployments on vSphere using Packer

Quickly deploy OpenShift 4 UPI on vSphere using CoreOS ISO for static network configuration deployments using Packer

JR Morgan

1 minute read

Why?

If you’re deploying OpenShift 4.x into vSphere environments without DHCP your deployment options are limited to using Red Hat CoreOS ISOs. This isn’t a big deal, but manually typing the kernel arguments for bootstrap, master, and compute nodes can become a headache, and leads to typos, cursing, and drinking.

How?

You can reduce UPI deployment time by using Packer and the vsphere-iso provider to create all VM’s, boot from ISO, automatically input appropriate kernel arguments (including proper ignition file references for each node type), install CoreOS, and shutdown each machine.

Usage

  1. Set environment variable with password to access vCenter (or use Vault) for secure variables
    export VSPHERE_PASS="YourP@ssword"
    
  2. Update the variables in rhcos.json or pass as supplemental -var options as shown below
  3. Execute Packer to build the VM, which will shutdown when complete
    packer build -var "vcenter_password=${VSPHERE_PASS}" rhcos.json
    

For full details consult the GitHub repo

Questions? Leave a comment!

comments powered by Disqus