Subscribe to our blog

Team, today I'm going to share something simple, but it helped a lot to avoid unnecessary work during the installation of Openshift 4.6 via PXE in bare metal.

According to the link on how to install the Openshift Environment via PXE, we need to edit the default file in the following path /var/lib/tftpboot/pxelinux.cfg/, in this file we need to determine the ignition file that will be loaded during the boot server, we must do this by editing ignition for the following servers: bootstrap, master and workers, once this modification is made, we start the respective servers.

In order to improve this process and make it easier, I created the boot menu below, where I already specify the 3 server profiles, through an interactive menu I can select which server it is and perform the installation.

Obs.: In this procedure, we will not cover the installation and configuration of PXE, only the menu.

So, let's start..

First, let's copy the file vesamenu.c32 to the tftp path:

cp /usr/share/syslinux/vesamenu.c32 /var/lib/tftpboot/

Download the bg-ocp.png image from the link below and save it to the /var/lib/tftpboot/ directory

$ wget https://raw.githubusercontent.com/leoaaraujo/openshift_pxe_boot_menu/main/files/bg-ocp.png -O /var/lib/tftpboot/bg-ocp.png

After that, we will edit or create the file with the entry menu of pxe boot, in my case it is /var/lib/tftpboot/pxelinux.cfg/default, add the lines below: 

UI vesamenu.c32
MENU BACKGROUND        bg-ocp.png   (1)
MENU COLOR sel         4  #ffffff std   (2)
MENU COLOR title       1  #ffffff    (3)
TIMEOUT 120
PROMPT 0
MENU TITLE OPENSHIFT 4.x INSTALL BARE METAL PXE MENU  (4)
LABEL INSTALL BOOTSTRAP    (5)
KERNEL http://{{ HTTP SERVER }}/rhcos-live-kernel-x86_64
APPEND initrd=http://{{ HTTP SERVER }}/rhcos-live-initramfs.x86_64.img coreos.live.rootfs_url=http://{{ HTTP SERVER }}/rhcos-live-rootfs.x86_64.img coreos.inst.install_dev=/dev/sda coreos.inst.ignition_url=http://{{ HTTP SERVER }}/bootstrap.ign
LABEL INSTALL MASTER       (5)
KERNEL http://{{ HTTP SERVER }}/rhcos-live-kernel-x86_64
APPEND initrd=http://{{ HTTP SERVER }}/rhcos-live-initramfs.x86_64.img coreos.live.rootfs_url=http://{{ HTTP SERVER }}/rhcos-live-rootfs.x86_64.img coreos.inst.install_dev=/dev/sda coreos.inst.ignition_url=http://{{ HTTP SERVER }}/master.ign
LABEL INSTALL WORKER       (5)
KERNEL http://{{ HTTP SERVER }}/rhcos-live-kernel-x86_64
APPEND initrd=http://{{ HTTP SERVER }}/rhcos-live-initramfs.x86_64.img coreos.live.rootfs_url=http://{{ HTTP SERVER }}/rhcos-live-rootfs.x86_64.img coreos.inst.install_dev=/dev/sda coreos.inst.ignition_url=http://{{ HTTP SERVER }}/worker.ign
  1. Set the image downloaded previously, this image is optional, not mandatory and can be replaced
  2. Set the color in the selection menu
  3. Set the color in Title menu
  4. Define title for menu
  5. Define the name of item in menu

Obs.:  Adjust the HTTP/HTTPS call, informing the IP or FQDN of your HTTP Server, where the img and ign files are stored

 

After the above steps have been successfully executed, start your server and identify if it already starts with the custom boot menu

Open the Web Console to interact

After press tab to edit, we can see the options Git Repository: https://github.com/leoaaraujo/openshift_pxe_boot_menu

References

For more customization options of the pxe menu, click here.

For more customization options for CoreOS during pxe boot, see here


About the author

Browse by channel

automation icon

Automation

The latest on IT automation that spans tech, teams, and environments

AI icon

Artificial intelligence

Explore the platforms and partners building a faster path for AI

open hybrid cloud icon

Open hybrid cloud

Explore how we build a more flexible future with hybrid cloud

security icon

Security

Explore how we reduce risks across environments and technologies

edge icon

Edge computing

Updates on the solutions that simplify infrastructure at the edge

Infrastructure icon

Infrastructure

Stay up to date on the world’s leading enterprise Linux platform

application development icon

Applications

The latest on our solutions to the toughest application challenges

Original series icon

Original shows

Entertaining stories from the makers and leaders in enterprise tech