Red Hat OpenShift is a comprehensive application platform that provides a robust and scalable solution for deploying, managing and scaling containerized applications. OpenShift is built on top of Kubernetes, the popular open source container orchestration platform, but extends its capabilities to be much, much more than just that. With the release of OpenShift 4.14, the agent-based installer now supports preboot execution environment (PXE) booting for master and worker nodes, offering a streamlined approach to cluster deployment. In this article, I will walk you through the details of this new feature.
What is agent-based installation?
The agent-based installation method introduces flexibility that lets users boot their on-premises servers in the manner they choose. It combines the user-friendliness of the assisted installation service with offline capabilities, including deployment in air-gapped environments. This method is a subcommand of the OpenShift installer. It generates a bootable ISO image containing all the necessary information to deploy an OpenShift cluster, complete with an available release image.
The configuration for agent-based installation follows the same format as the installer-provisioned infrastructure and user-provisioned infrastructure installation methods. Moreover, the agent-based installer can optionally generate or accept zero-touch provisioning (ZTP) custom resources, facilitating the provisioning of new edge sites with declarative configurations for bare metal equipment.
Get the latest agent-based installer
To begin, make sure you have the latest OpenShift installer binary (version 4.14). Download the latest OpenShift installer binary from Red Hat Hybrid Cloud Console – for example, here is the agent-based installer to install OpenShift on bare metal locally with agent: https://console.redhat.com/openshift/install/metal/agent-based
Downloading the agent-based installer
Use this procedure to download the agent-based installer and the command line interface (CLI) needed for your installation:
- Log into the OpenShift web console using your login credentials
- Navigate to Datacenter
- Click Run Agent-based Installer locally
- Select the operating system and architecture for the OpenShift Installer and command line interface
- Click Download Installer to download and extract the install program
- You can either download or copy the pull secret by clicking on Download pull secret or Copy pull secret
- Click Download command-line tools and place the openshift-install binary in a directory that is on your PATH
You can familiarize yourself with OpenShift with the official documentation:
Installation and update | Architecture | OpenShift Container Platform 4.14
What is PXE booting?
Preboot execution environment is a standard that enables network booting of a computing device. Instead of relying on local storage or removable media, PXE allows a machine to boot an operating system directly from the network. This is particularly valuable in large-scale deployments, data centers, or scenarios where centralized control over the boot process is beneficial.
10 advantages of PXE booting
PXE booting provides several advantages in enterprise and data center environments:
- Network-based booting: Enables computers to boot over a network, eliminating the need for physical storage media
- Centralized management: Facilitates centralized management of operating system images, providing consistency across connected machines
- Streamlined deployment: Simplifies large-scale deployments by saving time and reducing the risk of errors associated with manual installations
- Remote booting and installation: Supports remote booting and installation, ideal for geographically dispersed systems or those with limited physical access
- Reduced physical media dependency: Eliminates the need for physical media, reducing costs and contributing to a more environmentally friendly approach
- Flexible configuration: Allows for flexible configuration options, such as selecting different OS images or configuring network settings during boot
- Automation and scripting: Integrates with automated deployment processes, helping provide consistency and reducing manual intervention during installations
- Rescue and recovery operations: Useful for diagnostics, troubleshooting and recovery operations without relying on physical media
- Diskless systems: Supports the creation of diskless systems, where the OS and applications are loaded entirely from the network
- Scalability: Scalable and efficient for managing updates or changes across numerous systems simultaneously
Create PXE files
With OpenShift 4.14, the agent-based installer introduces a new subcommand: openshift-install agent create pxe-files
. This command facilitates the creation of PXE files necessary for booting master and worker nodes. Similar to the existing openshift-install agent create image
command, create pxe-files
supports the install-config.yaml
and agent-config.yaml
files, along with compatibility with ZTP manifests.
The command generates three essential PXE files: initrd, rootfs and kernel. Optionally, it can also produce an iPXE script file if the agent-config.yaml
includes a "bootArtifactsBaseURL" field which takes the predetermined location where users will upload the generated PXE files and will be accessible by the node when it boots. All the files the command creates are stored in the boot-artifacts
directory at your current path.
Prepare agent-config.yaml and install-config.yaml
Once your PXE infrastructure is in place, prepare the necessary configuration files for the installation process. Modify the agent-config.yaml
and install-config.yaml
files to match your specific environment. This example uses the optional bootArtifactsBaseURL in the agent-config.yaml. Use of this field is recommended as it autogenerates the iPXE script file, which helps the PXE booting process.
# agent-config.yaml
apiVersion: v1alpha1
metadata:
name: openshift-demo
namespace: agent
rendezvousIP: 192.168.122.10
bootArtifactsBaseURL: http://user-specified-pxe-infra.com
# install-config.yaml
apiVersion: v1
metadata:
name: openshift-demo
baseDomain: openshift-demo.agent.org
networking:
clusterNetwork:
- cidr: 10.128.0.0/14
hostPrefix: 23
networkType: OVNKubernetes
machineNetwork:
- cidr: 192.168.122.0/24
serviceNetwork:
- 172.30.0.0/16
compute:
- architecture: amd64
hyperthreading: Enabled
name: worker
replicas: 2
controlPlane:
architecture: amd64
hyperthreading: Enabled
name: master
replicas: 3
platform:
baremetal:
apiVips:
- 192.168.111.5
ingressVips:
- 192.168.111.4
sshKey: <PUBLIC_SSH_KEY>
pullSecret: '<PULL_SECRET>'
Generate the PXE files
Once the input files are prepared according to your environment, simply run the command openshift-install agent create pxe-files, which will generate the following files in the bootArtifacts directory.
bootArtifacts
- agent.x86_64-initrd.img
- agent.x86_64-rootfs.img
- agent.x86_64-vmlinuz
- agent.x86_64.ipxe
The generated agent.x86_64.ipxe
script file in this example will look like this:
#!ipxe
initrd --name initrd http://user-specified-pxe-infra.com/agent.x86_64-initrd.img
kernel http://user-specified-pxe-infra.com/agent.x86_64-vmlinuz initrd=initrd coreos.live.rootfs_url=http://user-specified-pxe-infra.com/agent.x86_64-rootfs.img mitigations=auto,nosmt ignition.firstboot ignition.platform.id=metal
boot
Upload PXE files
After creating the PXE files, upload them to a location accessible by your PXE-enabled infrastructure during the boot process (i.e., the same location mentioned in the agent-config.yaml
via bootArtifactsBaseURL
i.e., http://user-specified-pxe-infra.com
). This allows nodes to retrieve the necessary files for a seamless boot experience.
Key use cases and benefits
One notable advantage of openshift-install agent create pxe-files
over openshift-install agent create image
is the ability to reuse PXE files. In scenarios where multiple OpenShift clusters need deployment—such as in a data center with a requirement for 1000 clusters—the rootfs file can be shared among nodes.
This is possible because only the initrd and kernel are cluster-specific and iPXE script file is specific to your PXE environment and cluster-specific, while the rootfs remains generic for all the clusters. This optimization significantly reduces disk space requirements, with the initrd and kernel consuming a mere 100 MB whereas if generated, each ISO would have taken approx 800MB of disk space.
Conclusion
The integration of PXE booting with the agent-based installer in OpenShift 4.14 marks a significant stride toward efficient, scalable and flexible cluster deployment. The openshift-install agent create pxe-files
command empowers users with a powerful toolset to streamline the boot process and optimizes resource utilization in large-scale deployments.
Learn more
About the author
Browse by channel
Automation
The latest on IT automation for tech, teams, and environments
Artificial intelligence
Updates on the platforms that free customers to run AI workloads anywhere
Open hybrid cloud
Explore how we build a more flexible future with hybrid cloud
Security
The latest on how we reduce risks across environments and technologies
Edge computing
Updates on the platforms that simplify operations at the edge
Infrastructure
The latest on the world’s leading enterprise Linux platform
Applications
Inside our solutions to the toughest application challenges
Original shows
Entertaining stories from the makers and leaders in enterprise tech
Products
- Red Hat Enterprise Linux
- Red Hat OpenShift
- Red Hat Ansible Automation Platform
- Cloud services
- See all products
Tools
- Training and certification
- My account
- Customer support
- Developer resources
- Find a partner
- Red Hat Ecosystem Catalog
- Red Hat value calculator
- Documentation
Try, buy, & sell
Communicate
About Red Hat
We’re the world’s leading provider of enterprise open source solutions—including Linux, cloud, container, and Kubernetes. We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.
Select a language
Red Hat legal and privacy links
- About Red Hat
- Jobs
- Events
- Locations
- Contact Red Hat
- Red Hat Blog
- Diversity, equity, and inclusion
- Cool Stuff Store
- Red Hat Summit