Preparing To Install OpenShift on KVM
Note: This is part of a series. Make sure you started here: Building a Portable Kubernetes Home Lab with OpenShift - OKD4
-
If you did not set up a mirror of the CentOS Stream install files when you set up your Raspberry Pi. You will need to do that now.
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null root@10.11.12.10 "nohup /root/bin/MirrorSync.sh &"
This will take a while to complete. Wait until the MirrorSynch process on your Pi is complete. Depending on network speed, this could take an hour or more.
-
Set the shell environment from the lab configuration file that we created earlier:
labctx dev
-
Create an encrypted root password for your KVM host:
read KVM_ROOT_PWD
Type the password that you want to set for your KVM hosts and hit
<return>
openssl passwd -1 "${KVM_ROOT_PWD}" > ${OKD_LAB_PATH}/lab_host_pw
-
Add your workstation’s public SSH key to the authorized keys file that the KVM host will install:
cat ~/.ssh/id_rsa.pub | ssh root@bastion.${LAB_DOMAIN} "cat >> /usr/local/www/install/postinstall/authorized_keys"
-
Read the
MAC
address off of the bottom of the NUC and add it to the cluster config file:Edit
${HOME}/okd-lab/lab-config/domain-configs/dev.yaml
and replaceYOUR_HOST_MAC_HERE
with the MAC address of your NUC.Note: Use lower case letters in the MAC.
-
You need to know whether you have NVME or SATA SSDs in the NUC.
-
If you have an NVME drive installed in the NUC, you do not need to modify anything.
-
If you have SATA M.2 drive instead of NVME then edit:
${OKD_LAB_PATH}/lab-config/domain-configs/dev.yaml
, and replacenvme0n1
withsda
. -
If you have more than one drive installed, then edit:
${OKD_LAB_PATH}/lab-config/domain-configs/dev.yaml
, and replacedisk2: NA
withdisk2: nvme0n2
ordisk2: sdb
as appropriate
-
Once you have completed the configuration file changes, Deploy the KVM hosts:
-
Prepare for the CentOS Stream install:
labcli --deploy -k -d=dev
This command will configure the
iPXE
andkickstart
files for you as well as create the appropriateDNS
records. -
We are now ready to plug in the NUC and boot it up.
Note: This is the point at which you might have to attach a keyboard and monitor to your NUC. We need to ensure that the BIOS is set up to attempt a Network Boot with UEFI, not legacy. You also need to ensure that
Secure Boot
is disabled in the BIOS since we are not explicitly trusting the boot images.Also, Take this opportunity to apply the latest BIOS to your NUC.__ You won’t need the keyboard or mouse again, until it’s time for another BIOS update… Eventually we’ll figure out how to push those from the OS too. ;-)
-
Make sure that the KVM host is connected to your network and power it on.
At this point, it should PXE boot off of the router, and start an unattended install of CentOS Stream.
Attach a monitor and keyboard if you want to watch.
- The host will power on and find no bootable OS
- The host will attempt a network boot by requesting a DHCP address and PXE boot info
- The DHCP server will issue an IP address and direct the host to the PXE boot file on the TFTP boot server
- The host will retrieve the
boot.ipxe
file from the TFTP boot server - The
boot.ipxe
script will then retrieve an iPXE script name from the MAC address of the host. - The host will begin booting:
- The host will retrieve the
vmlinuz
, andinitrd
files from the HTTP install server - The host will load the kernel and init-ram
- The host will retrieve the kickstart file or ignition config file depending on the install type.
- The host will retrieve the
- The host should now begin an unattended install.