To install OKD on bare metal infrastructure that you provision, you must install Fedora CoreOS (FCOS) on the machines. When you install FCOS, you must provide the Ignition config file that was generated by the OKD installation program for the type of machine you are installing. If you have configured suitable networking, DNS, and load balancing infrastructure, the OKD bootstrap process begins automatically after the FCOS machines have rebooted.
To install FCOS on the machines, follow either the steps to use an ISO image or network PXE booting.
|
|
The compute node deployment steps included in this installation document are FCOS-specific. If you choose instead to deploy Fedora-based compute nodes, you take responsibility for all operating system life cycle management and maintenance, including performing system updates, applying patches, and completing all other required tasks. Only Fedora 8 compute machines are supported.
|
You can configure FCOS during ISO and PXE installations by using the following methods:
-
Kernel arguments: You can use kernel arguments to provide installation-specific information. For example, you can specify the locations of the FCOS installation files that you uploaded to your HTTP server and the location of the Ignition config file for the type of node you are installing. For a PXE installation, you can use the APPEND parameter to pass the arguments to the kernel of the live installer. For an ISO installation, you can interrupt the live installation boot process to add the kernel arguments. In both installation cases, you can use special coreos.inst.* arguments to direct the live installer, as well as standard installation boot arguments for turning standard kernel services on or off.
-
Ignition configs: OKD Ignition config files (*.ign) are specific to the type of node you are installing. You pass the location of a bootstrap, control plane, or compute node Ignition config file during the FCOS installation so that it takes effect on first boot. In special cases, you can create a separate, limited Ignition config to pass to the live system. That Ignition config could do a certain set of tasks, such as reporting success to a provisioning system after completing installation. This special Ignition config is consumed by the coreos-installer to be applied on first boot of the installed system. Do not provide the standard control plane and compute node Ignition configs to the live ISO directly.
-
coreos-installer: You can boot the live ISO installer to a shell prompt, which allows you to prepare the permanent system in a variety of ways before first boot. In particular, you can run the coreos-installer command to identify various artifacts to include, work with disk partitions, and set up networking. In some cases, you can configure features on the live system and copy them to the installed system.
|
|
As of version 0.17.0-3, coreos-installer requires Fedora 9 or later to run the program. You can still use older versions of coreos-installer to customize FCOS artifacts of newer OKD releases and install metal images to disk. You can download older versions of the coreos-installer binary from the coreos-installer image mirror page.
|
Whether to use an ISO or PXE install depends on your situation. A PXE install requires an available DHCP service and more preparation, but can make the installation process more automated. An ISO install is a more manual process and can be inconvenient if you are setting up more than a few machines.
You can use an ISO image to install FCOS on the machines.
Prerequisites
-
You have created the Ignition config files for your cluster.
-
You have configured suitable network, DNS and load balancing infrastructure.
-
You have an HTTP server that can be accessed from your computer, and from the machines that you create.
-
You have reviewed the Advanced FCOS installation configuration section for different ways to configure features, such as networking and disk partitioning.
Procedure
-
Obtain the SHA512 digest for each of your Ignition config files. For example, you can use the following on a system running Linux to get the SHA512 digest for your bootstrap.ign Ignition config file:
$ sha512sum <installation_directory>/bootstrap.ign
The digests are provided to the coreos-installer in a later step to validate the authenticity of the Ignition config files on the cluster nodes.
-
Upload the bootstrap, control plane, and compute node Ignition config files that the installation program created to your HTTP server. Note the URLs of these files.
|
|
You can add or change configuration settings in your Ignition configs before saving them to your HTTP server. If you plan to add more compute machines to your cluster after you finish installation, do not delete these files.
|
-
From the installation host, validate that the Ignition config files are available on the URLs. The following example gets the Ignition config file for the bootstrap node:
$ curl -k http://<HTTP_server>/bootstrap.ign
-
Although it is possible to obtain the FCOS images that are required for your preferred method of installing operating system instances from the
FCOS
page, the recommended way to obtain the correct version of your FCOS images are from the output of openshift-install command:
$ openshift-install coreos print-stream-json | grep '\.iso[^.]'
Example output
"location": "<url>/prod/streams/stable/builds/<release>/x86_64/fedora-coreos-<release>-live.x86_64.iso",
|
|
The FCOS images might not change with every release of OKD. You must download images with the highest version that is less than or equal to the OKD version that you install. Use the image versions that match your OKD version if they are available. Use only ISO images for this procedure. FCOS qcow2 images are not supported for this installation type.
|
ISO file names resemble the following example:
fedora-coreos-<version>-live.<architecture>.iso
-
Use the ISO to start the FCOS installation. Use one of the following installation options:
-
Boot the FCOS ISO image without specifying any options or interrupting the live boot sequence. Wait for the installer to boot into a shell prompt in the FCOS live environment.
|
|
It is possible to interrupt the FCOS installation boot process to add kernel arguments. However, for this ISO procedure you should use the coreos-installer command as outlined in the following steps, instead of adding kernel arguments.
|
-
Run the coreos-installer command and specify the options that meet your installation requirements. At a minimum, you must specify the URL that points to the Ignition config file for the node type, and the device that you are installing to:
$ sudo coreos-installer install --ignition-url=http://<HTTP_server>/<node_type>.ign <device> \
--ignition-hash=sha512-<digest>
-
<device>: You must run the coreos-installer command by using sudo, because the core user does not have the required root privileges to perform the installation.
-
<digest>: The --ignition-hash option is required when the Ignition config file is obtained through an HTTP URL to validate the authenticity of the Ignition config file on the cluster node. <digest> is the Ignition config file SHA512 digest obtained in a preceding step.
|
|
If you want to provide your Ignition config files through an HTTPS server that uses TLS, you can add the internal certificate authority (CA) to the system trust store before running coreos-installer.
|
+
The following example initializes a bootstrap node installation to the /dev/sda device. The Ignition config file for the bootstrap node is obtained from an HTTP web server with the IP address 192.168.1.2:
-
Monitor the progress of the FCOS installation on the console of the machine.
-
After FCOS installs, you must reboot the system. During the system reboot, it applies the Ignition config file that you specified.
-
Check the console output to verify that Ignition ran.
Example command
Ignition: ran on 2022/03/14 14:48:33 UTC (this boot)
Ignition: user-provided config was applied
-
Continue to create the other machines for your cluster.
|
|
You must create the bootstrap and control plane machines at this time. If the control plane machines are not made schedulable, also create at least two compute machines before you install OKD.
|
If the required network, DNS, and load balancer infrastructure are in place, the OKD bootstrap process begins automatically after the FCOS nodes have rebooted.
|
|
FCOS nodes do not include a default password for the core user. You can access the nodes by running ssh core@<node>.<cluster_name>.<base_domain> as a user with access to the SSH private key that is paired to the public key that you specified in your install_config.yaml file. OKD 4 cluster nodes running FCOS are immutable and rely on Operators to apply cluster changes. Accessing cluster nodes by using SSH is not recommended. However, when investigating installation issues, if the OKD API is not available, or the kubelet is not properly functioning on a target node, SSH access might be required for debugging or disaster recovery.
|
You can use PXE or iPXE booting to install FCOS on the machines.
Prerequisites
-
You have created the Ignition config files for your cluster.
-
You have configured suitable network, DNS and load balancing infrastructure.
-
You have configured suitable PXE or iPXE infrastructure.
-
You have an HTTP server that can be accessed from your computer, and from the machines that you create.
-
You have reviewed the Advanced FCOS installation configuration section for different ways to configure features, such as networking and disk partitioning.
Procedure
-
Upload the bootstrap, control plane, and compute node Ignition config files that the
installation program created to your HTTP server. Note the URLs of these files.
|
|
You can add or change configuration settings in your Ignition configs
before saving them to your HTTP server.
If you plan to add more compute machines to your cluster after you finish
installation, do not delete these files.
|
-
From the installation host, validate that the Ignition config files are available on the URLs. The following example gets the Ignition config file for the bootstrap node:
$ curl -k http://<HTTP_server>/bootstrap.ign
-
Although it is possible to obtain the FCOS kernel, initramfs and rootfs
files that are required for your preferred method of installing operating system instances from the
FCOS
page, the recommended way to obtain the correct version of your FCOS files are
from the output of openshift-install command:
$ openshift-install coreos print-stream-json | grep -Eo '"https.*(kernel-|initramfs.|rootfs.)\w+(\.img)?"'
Example output
"<url>/prod/streams/stable/builds/<release>/x86_64/fedora-coreos-<release>-live-kernel-x86_64"
"<url>/prod/streams/stable/builds/<release>/x86_64/fedora-coreos-<release>-live-initramfs.x86_64.img"
"<url>/prod/streams/stable/builds/<release>/x86_64/fedora-coreos-<release>-live-rootfs.x86_64.img"
|
|
The FCOS artifacts might not change with every release of OKD.
You must download images with the highest version that is less than or equal
to the OKD version that you install. Only use
the appropriate kernel, initramfs, and rootfs artifacts described below
for this procedure.
FCOS QCOW2 images are not supported for this installation type.
|
The file names contain the OKD version number. They resemble the following examples:
-
kernel: fedora-coreos-<version>-live-kernel-<architecture>
-
initramfs: fedora-coreos-<version>-live-initramfs.<architecture>.img
-
rootfs: fedora-coreos-<version>-live-rootfs.<architecture>.img
-
Upload the rootfs, kernel, and initramfs files
to your HTTP server.
|
|
If you plan to add more compute machines to your cluster after you finish
installation, do not delete these files.
|
-
Configure the network boot infrastructure so that the machines boot from their
local disks after FCOS is installed on them.
-
Configure PXE or iPXE installation for the FCOS images and begin the installation.
-
Modify one of the following example menu entries for your environment and verify that the image and Ignition files are properly accessible:
-
For PXE (x86_64):
DEFAULT pxeboot
TIMEOUT 20
PROMPT 0
LABEL pxeboot
KERNEL http://<HTTP_server>/rhcos-<version>-live-kernel-<architecture>
APPEND initrd=http://<HTTP_server>/rhcos-<version>-live-initramfs.<architecture>.img coreos.live.rootfs_url=http://<HTTP_server>/rhcos-<version>-live-rootfs.<architecture>.img coreos.inst.install_dev=/dev/sda coreos.inst.ignition_url=http://<HTTP_server>/bootstrap.ign
kernel
-
Specify the location of the live kernel file that you uploaded to your HTTP
server. The URL must be HTTP, TFTP, or FTP; HTTPS and NFS are not supported.
initrd=main
-
If you use multiple NICs, specify a single interface in the ip option. For example, to use DHCP on a NIC that is named eno1, set ip=eno1:dhcp. Specify the locations of the FCOS files that you uploaded to your HTTP server. The initrd parameter value is the location of the initramfs file, the coreos.live.rootfs_url parameter value is the location of the rootfs file, and the coreos.inst.ignition_url parameter value is the location of the bootstrap Ignition config file. You can also add more kernel arguments to the APPEND line to configure networking or other boot options.
|
|
This configuration does not enable serial console access on machines with a graphical console. To configure a different console, add one or more console= arguments to the APPEND line. For example, add console=tty0 console=ttyS0 to set the first PC serial port as the primary console and the graphical console as a secondary console. For more information, see How does one set up a serial terminal and/or console in Red Hat Enterprise Linux? and "Enabling the serial console for PXE and ISO installation" in the "Advanced FCOS installation configuration" section.
|
-
For iPXE (x86_64
):
kernel http://<HTTP_server>/rhcos-<version>-live-kernel-<architecture> initrd=main coreos.live.rootfs_url=http://<HTTP_server>/rhcos-<version>-live-rootfs.<architecture>.img coreos.inst.install_dev=/dev/sda coreos.inst.ignition_url=http://<HTTP_server>/bootstrap.ign
initrd --name main http://<HTTP_server>/rhcos-<version>-live-initramfs.<architecture>.img
boot
kernel
-
Specify the locations of the FCOS files that you uploaded to your HTTP server. The kernel parameter value is the location of the kernel file, the initrd=main argument is needed for booting on UEFI systems, the coreos.live.rootfs_url parameter value is the location of the rootfs file, and the coreos.inst.ignition_url parameter value is the location of the bootstrap Ignition config file. If you use multiple NICs, specify a single interface in the ip option.
For example, to use DHCP on a NIC that is named eno1, set ip=eno1:dhcp.
initrd
-
Specify the location of the initramfs file that you uploaded to your HTTP server.
|
|
This configuration does not enable serial console access on machines with a graphical console. To configure a different console, add one or more console= arguments to the kernel line. For example, add console=tty0 console=ttyS0 to set the first PC serial port as the primary console and the graphical console as a secondary console. For more information, see How does one set up a serial terminal and/or console in Red Hat Enterprise Linux? and "Enabling the serial console for PXE and ISO installation" in the "Advanced FCOS installation configuration" section.
|
-
Monitor the progress of the FCOS installation on the console of the machine.
|
|
Be sure that the installation is successful on each node before commencing with the OKD installation. Observing the installation process can also help to determine the cause of FCOS installation issues that might arise.
|
-
After FCOS installs, the system reboots. During reboot, the system applies the Ignition config file that you specified.
-
Check the console output to verify that Ignition ran.
Example command
Ignition: ran on 2022/03/14 14:48:33 UTC (this boot)
Ignition: user-provided config was applied
-
Continue to create the machines for your cluster.
|
|
You must create the bootstrap and control plane machines at this time. If the
control plane machines are not made schedulable, also
create at least two compute machines before you install the cluster.
|
If the required network, DNS, and load balancer infrastructure are in place, the OKD bootstrap process begins automatically after the FCOS nodes have rebooted.
|
|
FCOS nodes do not include a default password for the core user. You can access the nodes by running ssh core@<node>.<cluster_name>.<base_domain> as a user with access to the SSH private key that is paired to the public key that you specified in your install_config.yaml file. OKD 4 cluster nodes running FCOS are immutable and rely on Operators to apply cluster changes. Accessing cluster nodes by using SSH is not recommended. However, when investigating installation issues, if the OKD API is not available, or the kubelet is not properly functioning on a target node, SSH access might be required for debugging or disaster recovery.
|
A key benefit for manually provisioning the Fedora CoreOS (FCOS) nodes for OKD is to be able to do configuration that is not available through default OKD installation methods. This section describes some of the configurations that you can do using techniques that include:
-
Passing kernel arguments to the live installer
-
Running coreos-installer manually from the live system
-
Customizing a live ISO or PXE boot image
The advanced configuration topics for manual Fedora CoreOS (FCOS) installations detailed in this section relate to disk partitioning, networking, and using Ignition configs in different ways.
Fedora CoreOS (FCOS) nodes installed from an OKD 4.17 boot image use a default console that is meant to accomodate most virtualized and bare metal setups. Different cloud and virtualization platforms may use different default settings depending on the chosen architecture. Bare metal installations use the kernel default settings which typically means the graphical console is the primary console and the serial console is disabled.
The default consoles may not match your specific hardware configuration or you might have specific needs that require you to adjust the default console. For example:
-
You want to access the emergency shell on the console for debugging purposes.
-
Your cloud platform does not provide interactive access to the graphical console, but provides a serial console.
-
You want to enable multiple consoles.
Console configuration is inherited from the boot image. This means that new nodes in existing clusters are unaffected by changes to the default console.
You can configure the console for bare metal installations in the following ways:
-
Using coreos-installer manually on the command line.
-
Using the coreos-installer iso customize or coreos-installer pxe customize subcommands with the --dest-console option to create a custom image that automates the process.
|
|
For advanced customization, perform console configuration using the coreos-installer iso or coreos-installer pxe subcommands, and not kernel arguments.
|
By default, the Fedora CoreOS (FCOS) serial console is disabled and all output is written to the graphical console. You can enable the serial console for an ISO installation and reconfigure the bootloader so that output is sent to both the serial console and the graphical console.
Procedure
-
Boot the ISO installer.
-
Run the coreos-installer command to install the system, adding the --console option once to specify the graphical console, and a second time to specify the serial console:
$ coreos-installer install \
--console=tty0 \
--console=ttyS0,<options> \
--ignition-url=http://host/worker.ign /dev/disk/by-id/scsi-<serial_number>
--console=tty0
-
The desired secondary console. In this case, the graphical console. Omitting this option will disable the graphical console.
--console=ttyS0
-
The desired primary console. In this case the serial console. The options field defines the baud rate and other settings. A common value for this field is 115200n8. If no options are provided, the default kernel value of 9600n8 is used. For more information on the format of this option, see Linux kernel serial console documentation.
-
Reboot into the installed system.
|
|
A similar outcome can be obtained by using the coreos-installer install --append-karg option, and specifying the console with console=. However, this will only set the console for the kernel and not the bootloader.
|
To configure a PXE installation, make sure the coreos.inst.install_dev kernel command-line option is omitted, and use the shell prompt to run coreos-installer manually using the above ISO installation procedure.
You can use the live ISO image or PXE environment to install FCOS by injecting an Ignition config file directly into the image. This creates a customized image that you can use to provision your system.
For an ISO image, the mechanism to do this is the coreos-installer iso customize subcommand, which modifies the .iso file with your configuration. Similarly, the mechanism for a PXE environment is the coreos-installer pxe customize subcommand, which creates a new initramfs file that includes your customizations.
The customize subcommand is a general purpose tool that can embed other types of customizations as well. The following tasks are examples of some of the more common customizations:
-
Inject custom CA certificates for when corporate security policy requires their use.
-
Configure network settings without the need for kernel arguments.
-
Embed arbitrary preinstall and post-install scripts or binaries.
You can customize a live FCOS ISO image directly with the
coreos-installer iso customize
subcommand. When you boot the ISO image, the customizations are applied automatically.
You can use this feature to configure the ISO image to automatically install FCOS.
Procedure
-
Download the coreos-installer binary from the coreos-installer image mirror page.
-
Retrieve the FCOS ISO image from the FCOS image mirror page and the Ignition config file, and then run the following command to inject the Ignition config directly into the ISO image:
$ coreos-installer iso customize rhcos-<version>-live.x86_64.iso \
--dest-ignition bootstrap.ign \
--dest-device /dev/disk/by-id/scsi-<serial_number>
--dest-ignition
-
The Ignition config file that is generated from the openshift-installer installation program.
--dest-device
-
When you specify this option, the ISO image automatically runs an installation. Otherwise, the image remains configured for installation, but does not install automatically unless you specify the coreos.inst.install_dev kernel argument.
-
Optional: To remove the ISO image customizations and return the image to its pristine state, run:
$ coreos-installer iso reset rhcos-<version>-live.x86_64.iso
You can now re-customize the live ISO image or use it in its pristine state.
Applying your customizations affects every subsequent boot of FCOS.
On clusters installed with OKD 4.12 and above, the serial console is disabled by default and all output is written to the graphical console. You can enable the serial console with the following procedure.
Procedure
-
Download the coreos-installer binary from the coreos-installer image mirror page.
-
Retrieve the FCOS ISO image from the FCOS image mirror page and run the following command to customize the ISO image to enable the serial console to receive output:
$ coreos-installer iso customize rhcos-<version>-live.x86_64.iso \
--dest-ignition <path> \//
--dest-console tty0 \//
--dest-console ttyS0,<options> \//
--dest-device /dev/disk/by-id/scsi-<serial_number>
<path>
-
The location of the Ignition config to install.
tty0
-
The desired secondary console. In this case, the graphical console. Omitting this option will disable the graphical console.
<options>
-
The desired primary console. In this case, the serial console. The options field defines the baud rate and other settings. A common value for this field is 115200n8. If no options are provided, the default kernel value of 9600n8 is used. For more information on the format of this option, see the Linux kernel serial console documentation.
<serial_number>
-
The specified disk to install to. If you omit this option, the ISO image automatically runs the installation program which will fail unless you also specify the coreos.inst.install_dev kernel argument.
|
|
The --dest-console option affects the installed system and not the live ISO system. To modify the console for a live ISO system, use the --live-karg-append option and specify the console with console=.
|
Your customizations are applied and affect every subsequent boot of the ISO image.
-
Optional: To remove the ISO image customizations and return the image to its original state, run the following command:
$ coreos-installer iso reset rhcos-<version>-live.x86_64.iso
You can now recustomize the live ISO image or use it in its original state.
You can provide certificate authority (CA) certificates to Ignition with the --ignition-ca flag of the customize subcommand. You can use the CA certificates during both the installation boot and when provisioning the installed system.
|
|
Custom CA certificates affect how Ignition fetches remote resources but they do not affect the certificates installed onto the system.
|
Procedure
-
Download the coreos-installer binary from the coreos-installer image mirror page.
-
Retrieve the FCOS ISO image from the FCOS image mirror page and run the following command to customize the ISO image for use with a custom CA:
$ coreos-installer iso customize rhcos-<version>-live.x86_64.iso --ignition-ca cert.pem
|
|
The coreos.inst.ignition_url kernel parameter does not work with the --ignition-ca flag.
You must use the --dest-ignition flag to create a customized image for each cluster.
|
Applying your custom CA certificate affects every subsequent boot of FCOS.
You can embed a NetworkManager keyfile into the live ISO image and pass it through to the installed system with the --network-keyfile flag of the customize subcommand.
|
|
When creating a connection profile, you must use a .nmconnection filename extension in the filename of the connection profile. If you do not use a .nmconnection filename extension, the cluster will apply the connection profile to the live environment, but it will not apply the configuration when the cluster first boots up the nodes, resulting in a setup that does not work.
|
Procedure
-
Download the coreos-installer binary from the coreos-installer image mirror page.
-
Create a connection profile for a bonded interface. For example, create the bond0.nmconnection file in your local directory with the following content:
/[connection]
id=bond0
type=bond
interface-name=bond0
multi-connect=1
/[bond]
miimon=100
mode=active-backup
/[ipv4]
method=auto
/[ipv6]
method=auto
-
Create a connection profile for a secondary interface to add to the bond. For example, create the bond0-proxy-em1.nmconnection file in your local directory with the following content:
/[connection]
id=em1
type=ethernet
interface-name=em1
master=bond0
multi-connect=1
slave-type=bond
-
Create a connection profile for a secondary interface to add to the bond. For example, create the bond0-proxy-em2.nmconnection file in your local directory with the following content:
/[connection]
id=em2
type=ethernet
interface-name=em2
master=bond0
multi-connect=1
slave-type=bond
-
Retrieve the FCOS ISO image from the FCOS image mirror page and run the following command to customize the ISO image with your configured networking:
$ coreos-installer iso customize rhcos-<version>-live.x86_64.iso \
--network-keyfile bond0.nmconnection \
--network-keyfile bond0-proxy-em1.nmconnection \
--network-keyfile bond0-proxy-em2.nmconnection
Network settings are applied to the live system and are carried over to the destination system.
You can set the iSCSI target and initiator values for automatic mounting, booting and configuration using a customized version of the live FCOS image.
Prerequisites
-
You have an iSCSI target you want to install FCOS on.
Procedure
-
Download the coreos-installer binary from the coreos-installer image mirror page.
-
Retrieve the FCOS ISO image from the FCOS image mirror page and run the following command to customize the ISO image with the following information:
$ coreos-installer iso customize \
--pre-install mount-iscsi.sh \
--post-install unmount-iscsi.sh \
--dest-device /dev/disk/by-path/<IP_address>:<port>-iscsi-<target_iqn>-lun-<lun> \
--dest-ignition config.ign \
--dest-karg-append rd.iscsi.initiator=<initiator_iqn> \
--dest-karg-append netroot=<target_iqn> \
-o custom.iso rhcos-<version>-live.x86_64.iso
mount-iscsi.sh
-
The script that gets run before installation. It should contain the iscsiadm commands for mounting the iSCSI target and any commands enabling multipathing.
unmount-iscsi.sh
-
The script that gets run after installation. It should contain the command iscsiadm --mode node --logout=all.
<target_iqn>
-
The location of the destination system. You must provide the IP address of the target portal, the associated port number, the target iSCSI node in IQN format, and the iSCSI logical unit number (LUN).
config.ign
-
The Ignition configuration for the destination system.
<initiator_iqn>
-
The iSCSI initiator, or client, name in IQN format. The initiator forms a session to connect to the iSCSI target.
<target_iqn>
-
The the iSCSI target, or server, name in IQN format.
You can set the iSCSI target and initiator values for automatic mounting, booting and configuration using a customized version of the live FCOS image.
Prerequisites
-
You have an iSCSI target you want to install FCOS on.
-
Optional: you have multipathed your iSCSI target.
Procedure
-
Download the coreos-installer binary from the coreos-installer image mirror page.
-
Retrieve the FCOS ISO image from the FCOS image mirror page and run the following command to customize the ISO image with the following information:
$ coreos-installer iso customize \
--pre-install mount-iscsi.sh \
--post-install unmount-iscsi.sh \
--dest-device /dev/mapper/mpatha \
--dest-ignition config.ign \
--dest-karg-append rd.iscsi.firmware=1 \
--dest-karg-append rd.multipath=default \
-o custom.iso rhcos-<version>-live.x86_64.iso
mount-iscsi.sh
-
The script that gets run before installation. It should contain the iscsiadm commands for mounting the iSCSI target and any commands enabling multipathing.
unmount-iscsi.sh
-
The script that gets run after installation. It should contain the command iscsiadm --mode node --logout=all.
/dev/mapper/mpatha
-
The path to the device. If you are using multipath, the multipath device, /dev/mapper/mpatha, If there are multiple multipath devices connected, or to be explicit, you can use the World Wide Name (WWN) symlink available in /dev/disk/by-path.
config.ign
-
The Ignition configuration for the destination system.
rd.iscsi.firmware=1
-
The iSCSI parameter is read from the BIOS firmware.
rd.multipath=default
-
Optional: include this parameter if you are enabling multipathing.
You can customize a live FCOS PXE environment directly with the
coreos-installer pxe customize
subcommand. When you boot the PXE environment, the customizations are applied automatically.
You can use this feature to configure the PXE environment to automatically install FCOS.
Procedure
-
Download the coreos-installer binary from the coreos-installer image mirror page.
-
Retrieve the FCOS kernel, initramfs and rootfs files from the FCOS image mirror page and the Ignition config file, and then run the following command to create a new initramfs file that contains the customizations from your Ignition config:
$ coreos-installer pxe customize rhcos-<version>-live-initramfs.x86_64.img \
--dest-ignition bootstrap.ign \
--dest-device /dev/disk/by-id/scsi-<serial_number> \
-o rhcos-<version>-custom-initramfs.x86_64.img
--dest-ignition
-
The Ignition config file that is generated from openshift-installer.
<serial_number>
-
When you specify this option, the PXE environment automatically runs an install. Otherwise, the image remains configured for installing, but does not do so automatically unless you specify the coreos.inst.install_dev kernel argument.
<version>
-
Use the customized initramfs file in your PXE configuration. Add the ignition.firstboot and ignition.platform.id=metal kernel arguments if they are not already present.
Applying your customizations affects every subsequent boot of FCOS.
On clusters installed with OKD 4.12 and above, the serial console is disabled by default and all output is written to the graphical console. You can enable the serial console with the following procedure.
Procedure
-
Download the coreos-installer binary from the coreos-installer image mirror page.
-
Retrieve the FCOS kernel, initramfs and rootfs files from the FCOS image mirror page and the Ignition config file, and then run the following command to create a new customized initramfs file that enables the serial console to receive output:
$ coreos-installer pxe customize rhcos-<version>-live-initramfs.x86_64.img \
--dest-ignition <path> \//
--dest-console tty0 \//
--dest-console ttyS0,<options> \//
--dest-device /dev/disk/by-id/scsi-<serial_number> \//
-o rhcos-<version>-custom-initramfs.x86_64.img
<path>
-
The location of the Ignition config to install.
tty0
-
The desired secondary console. In this case, the graphical console. Omitting this option will disable the graphical console.
<options>
-
The desired primary console. In this case, the serial console. The options field defines the baud rate and other settings. A common value for this field is 115200n8. If no options are provided, the default kernel value of 9600n8 is used. For more information on the format of this option, see the Linux kernel serial console documentation.
<serial_number>
-
The specified disk to install to. If you omit this option, the PXE environment automatically runs the installation program which will fail unless you also specify the coreos.inst.install_dev kernel argument.
<version>
-
Use the customized initramfs file in your PXE configuration. Add the ignition.firstboot and ignition.platform.id=metal kernel arguments if they are not already present.
Your customizations are applied and affect every subsequent boot of the PXE environment.
You can provide certificate authority (CA) certificates to Ignition with the --ignition-ca flag of the customize subcommand. You can use the CA certificates during both the installation boot and when provisioning the installed system.
|
|
Custom CA certificates affect how Ignition fetches remote resources but they do not affect the certificates installed onto the system.
|
Procedure
-
Download the coreos-installer binary from the coreos-installer image mirror page.
-
Retrieve the FCOS kernel, initramfs and rootfs files from the FCOS image mirror page and run the following command to create a new customized initramfs file for use with a custom CA:
$ coreos-installer pxe customize rhcos-<version>-live-initramfs.x86_64.img \
--ignition-ca cert.pem \
-o rhcos-<version>-custom-initramfs.x86_64.img
-
Use the customized initramfs file in your PXE configuration. Add the ignition.firstboot and ignition.platform.id=metal kernel arguments if they are not already present.
|
|
The coreos.inst.ignition_url kernel parameter does not work with the --ignition-ca flag.
You must use the --dest-ignition flag to create a customized image for each cluster.
|
Applying your custom CA certificate affects every subsequent boot of FCOS.
You can embed a NetworkManager keyfile into the live PXE environment and pass it through to the installed system with the --network-keyfile flag of the customize subcommand.
|
|
When creating a connection profile, you must use a .nmconnection filename extension in the filename of the connection profile. If you do not use a .nmconnection filename extension, the cluster will apply the connection profile to the live environment, but it will not apply the configuration when the cluster first boots up the nodes, resulting in a setup that does not work.
|
Procedure
-
Download the coreos-installer binary from the coreos-installer image mirror page.
-
Create a connection profile for a bonded interface. For example, create the bond0.nmconnection file in your local directory with the following content:
/[connection]
id=bond0
type=bond
interface-name=bond0
multi-connect=1
/[bond]
miimon=100
mode=active-backup
/[ipv4]
method=auto
/[ipv6]
method=auto
-
Create a connection profile for a secondary interface to add to the bond. For example, create the bond0-proxy-em1.nmconnection file in your local directory with the following content:
/[connection]
id=em1
type=ethernet
interface-name=em1
master=bond0
multi-connect=1
slave-type=bond
-
Create a connection profile for a secondary interface to add to the bond. For example, create the bond0-proxy-em2.nmconnection file in your local directory with the following content:
/[connection]
id=em2
type=ethernet
interface-name=em2
master=bond0
multi-connect=1
slave-type=bond
-
Retrieve the FCOS kernel, initramfs and rootfs files from the FCOS image mirror page and run the following command to create a new customized initramfs file that contains your configured networking:
$ coreos-installer pxe customize rhcos-<version>-live-initramfs.x86_64.img \
--network-keyfile bond0.nmconnection \
--network-keyfile bond0-proxy-em1.nmconnection \
--network-keyfile bond0-proxy-em2.nmconnection \
-o rhcos-<version>-custom-initramfs.x86_64.img
-
Use the customized initramfs file in your PXE configuration. Add the ignition.firstboot and ignition.platform.id=metal kernel arguments if they are not already present.
Network settings are applied to the live system and are carried over to the destination system.
You can set the iSCSI target and initiator values for automatic mounting, booting and configuration using a customized version of the live FCOS image.
Prerequisites
-
You have an iSCSI target you want to install FCOS on.
Procedure
-
Download the coreos-installer binary from the coreos-installer image mirror page.
-
Retrieve the FCOS kernel, initramfs and rootfs files from the FCOS image mirror page and run the following command to create a new customized initramfs file with the following information:
$ coreos-installer pxe customize \
--pre-install mount-iscsi.sh \
--post-install unmount-iscsi.sh \
--dest-device /dev/disk/by-path/<IP_address>:<port>-iscsi-<target_iqn>-lun-<lun> \
--dest-ignition config.ign \
--dest-karg-append rd.iscsi.initiator=<initiator_iqn> \
--dest-karg-append netroot=<target_iqn> \
-o custom.img rhcos-<version>-live-initramfs.x86_64.img
mount-iscsi.sh
-
The script that gets run before installation. It should contain the iscsiadm commands for mounting the iSCSI target and any commands enabling multipathing.
unmount-iscsi.sh
-
The script that gets run after installation. It should contain the command iscsiadm --mode node --logout=all.
<target_iqn>
-
The location of the destination system. You must provide the IP address of the target portal, the associated port number, the target iSCSI node in IQN format, and the iSCSI logical unit number (LUN).
config.ign
-
The Ignition configuration for the destination system.
<initiator_iqn>
-
The iSCSI initiator, or client, name in IQN format. The initiator forms a session to connect to the iSCSI target.
<target_iqn>
-
The the iSCSI target, or server, name in IQN format.
You can set the iSCSI target and initiator values for automatic mounting, booting and configuration using a customized version of the live FCOS image.
Prerequisites
-
You have an iSCSI target you want to install FCOS on.
-
Optional: you have multipathed your iSCSI target.
Procedure
-
Download the coreos-installer binary from the coreos-installer image mirror page.
-
Retrieve the FCOS kernel, initramfs and rootfs files from the FCOS image mirror page and run the following command to create a new customized initramfs file with the following information:
$ coreos-installer pxe customize \
--pre-install mount-iscsi.sh \
--post-install unmount-iscsi.sh \
--dest-device /dev/mapper/mpatha \
--dest-ignition config.ign \
--dest-karg-append rd.iscsi.firmware=1 \
--dest-karg-append rd.multipath=default \
-o custom.img rhcos-<version>-live-initramfs.x86_64.img
mount-iscsi.sh
-
The script that gets run before installation. It should contain the iscsiadm commands for mounting the iSCSI target.
unmount-iscsi.sh
-
The script that gets run after installation. It should contain the command iscsiadm --mode node --logout=all.
/dev/mapper/mpatha
-
The path to the device. If you are using multipath, the multipath device, /dev/mapper/mpatha, If there are multiple multipath devices connected, or to be explicit, you can use the World Wide Name (WWN) symlink available in /dev/disk/by-path.
config.ign
-
The Ignition configuration for the destination system.
rd.iscsi.firmware=1
-
The iSCSI parameter is read from the BIOS firmware.
rd.multipath=default
-
Optional: include this parameter if you are enabling multipathing.
You can configure advanced options so that you can modify the Fedora CoreOS (FCOS) manual installation process. The subsequent sections show examples of networking options for an ISO installation.
If you install FCOS from an ISO image, you can add kernel arguments manually when you boot the image to configure networking for a node. If no networking arguments are specified, DHCP is activated in the initramfs when FCOS detects that networking is required to fetch the Ignition config file.
|
|
When adding networking arguments manually, you must also add the rd.neednet=1 kernel argument to bring the network up in the initramfs.
|
The following information provides examples for configuring networking and bonding on your FCOS nodes for ISO installations. The examples describe how to use the ip=, nameserver=, and bond= kernel arguments.
|
|
Ordering is important when adding the kernel arguments: ip=, nameserver=, and then bond=.
|
The networking options are passed to the dracut tool during system boot. For more information about the networking options supported by dracut, see the dracut.cmdline manual page.
FCOS supports multipathing on the primary disk, allowing stronger resilience to hardware failure to achieve higher host availability.
You can enable multipathing at installation time for nodes that were provisioned in OKD 4.8 or later. While postinstallation support is available by activating multipathing via the machine config, enabling multipathing during installation is recommended.
In setups where any I/O to non-optimized paths results in I/O system errors, you must enable multipathing at installation time.
|
|
On IBM Z® and IBM® LinuxONE, you can enable multipathing only if you configured your cluster for it during installation. For more information, see "Installing FCOS and starting the OKD bootstrap process" in Installing a cluster with z/VM on IBM Z® and IBM® LinuxONE.
|
The following procedure enables multipath at installation time and appends kernel arguments to the coreos-installer install command so that the installed system itself will use multipath beginning from the first boot.
|
|
OKD does not support enabling multipathing as a day-2 activity on nodes that have been upgraded from 4.6 or earlier.
|
Procedure
-
To enable multipath and start the multipathd daemon, run the following command on the installation host:
$ mpathconf --enable && systemctl start multipathd.service
-
Optional: If booting the PXE or ISO, you can instead enable multipath by adding rd.multipath=default from the kernel command line.
-
Append the kernel arguments by invoking the coreos-installer program:
-
If there is only one multipath device connected to the machine, it should be available at path /dev/mapper/mpatha. For example:
$ coreos-installer install /dev/mapper/mpatha \//
--ignition-url=http://host/worker.ign \
--append-karg rd.multipath=default \
--append-karg root=/dev/disk/by-label/dm-mpath-root \
--append-karg rw
-
If there are multiple multipath devices connected to the machine, or to be more explicit, instead of using /dev/mapper/mpatha, it is recommended to use the World Wide Name (WWN) symlink available in /dev/disk/by-id. For example:
$ coreos-installer install /dev/disk/by-id/wwn-<wwn_ID> \//
--ignition-url=http://host/worker.ign \
--append-karg rd.multipath=default \
--append-karg root=/dev/disk/by-label/dm-mpath-root \
--append-karg rw
This symlink can also be used as the coreos.inst.install_dev kernel argument when using special coreos.inst.* arguments to direct the live installer. For more information, see "Installing FCOS and starting the OKD bootstrap process".
-
Reboot into the installed system.
-
Check that the kernel arguments worked by going to one of the worker nodes and listing the kernel command-line arguments (in /proc/cmdline on the host):
$ oc debug node/ip-10-0-141-105.ec2.internal
Example output
Starting pod/ip-10-0-141-105ec2internal-debug ...
To use host binaries, run `chroot /host`
sh-4.2# cat /host/proc/cmdline
...
rd.multipath=default root=/dev/disk/by-label/dm-mpath-root
...
sh-4.2# exit
You should see the added kernel arguments.
FCOS also supports multipathing on a secondary disk. Instead of kernel arguments, you use Ignition to enable multipathing for the secondary disk at installation time.
Prerequisites
-
You have read the section Disk partitioning.
-
You have read Enabling multipathing with kernel arguments on FCOS.
-
You have installed the Butane utility.
Procedure
-
Create a Butane config with information similar to the following:
Example multipath-config.bu
variant: openshift
version: 4.17.0
systemd:
units:
- name: mpath-configure.service
enabled: true
contents: |
[Unit]
Description=Configure Multipath on Secondary Disk
ConditionFirstBoot=true
ConditionPathExists=!/etc/multipath.conf
Before=multipathd.service (1)
DefaultDependencies=no
[Service]
Type=oneshot
ExecStart=/usr/sbin/mpathconf --enable (2)
[Install]
WantedBy=multi-user.target
- name: mpath-var-lib-container.service
enabled: true
contents: |
[Unit]
Description=Set Up Multipath On /var/lib/containers
ConditionFirstBoot=true (3)
Requires=dev-mapper-mpatha.device
After=dev-mapper-mpatha.device
After=ostree-remount.service
Before=kubelet.service
DefaultDependencies=no
[Service] (4)
Type=oneshot
ExecStart=/usr/sbin/mkfs.xfs -L containers -m reflink=1 /dev/mapper/mpatha
ExecStart=/usr/bin/mkdir -p /var/lib/containers
[Install]
WantedBy=multi-user.target
- name: var-lib-containers.mount
enabled: true
contents: |
[Unit]
Description=Mount /var/lib/containers
After=mpath-var-lib-containers.service
Before=kubelet.service (5)
[Mount] (6)
What=/dev/disk/by-label/dm-mpath-containers
Where=/var/lib/containers
Type=xfs
[Install]
WantedBy=multi-user.target
| 1 |
The configuration must be set before launching the multipath daemon. |
| 2 |
Starts the mpathconf utility. |
| 3 |
This field must be set to the value true. |
| 4 |
Creates the filesystem and directory /var/lib/containers. |
| 5 |
The device must be mounted before starting any nodes. |
| 6 |
Mounts the device to the /var/lib/containers mount point. This location cannot be a symlink. |
-
Create the Ignition configuration by running the following command:
$ butane --pretty --strict multipath-config.bu > multipath-config.ign
-
Continue with the rest of the first boot FCOS installation process.
|
|
Do not add the rd.multipath or root kernel arguments on the command-line during installation unless the primary disk is also multipathed.
|
You can manually install FCOS on an iSCSI target.
Prerequisites
-
You are in the FCOS live environment.
-
You have an iSCSI target that you want to install FCOS on.
Procedure
-
Mount the iSCSI target from the live environment by running the following command:
$ iscsiadm \
--mode discovery \
--type sendtargets
--portal <IP_address> \ (1)
--login
| 1 |
The IP address of the target portal. |
-
Install FCOS onto the iSCSI target by running the following command and using the necessary kernel arguments, for example:
$ coreos-installer install \
/dev/disk/by-path/ip-<IP_address>:<port>-iscsi-<target_iqn>-lun-<lun> \ (1)
--append-karg rd.iscsi.initiator=<initiator_iqn> \ (2)
--append.karg netroot=<target_iqn> \ (3)
--console ttyS0,115200n8
--ignition-file <path_to_file>
| 1 |
The location you are installing to. You must provide the IP address of the target portal, the associated port number, the target iSCSI node in IQN format, and the iSCSI logical unit number (LUN). |
| 2 |
The iSCSI initiator, or client, name in IQN format. The initiator forms a session to connect to the iSCSI target. |
| 3 |
The the iSCSI target, or server, name in IQN format. |
-
Unmount the iSCSI disk with the following command:
$ iscsiadm --mode node --logoutall=all
This procedure can also be performed using the coreos-installer iso customize or coreos-installer pxe customize subcommands.
On a completely diskless machine, the iSCSI target and initiator values can be passed through iBFT. iSCSI multipathing is also supported.
Prerequisites
-
You are in the FCOS live environment.
-
You have an iSCSI target you want to install FCOS on.
-
Optional: you have multipathed your iSCSI target.
Procedure
-
Mount the iSCSI target from the live environment by running the following command:
$ iscsiadm \
--mode discovery \
--type sendtargets
--portal <IP_address> \ (1)
--login
| 1 |
The IP address of the target portal. |
-
Optional: enable multipathing and start the daemon with the following command:
$ mpathconf --enable && systemctl start multipathd.service
-
Install FCOS onto the iSCSI target by running the following command and using the necessary kernel arguments, for example:
$ coreos-installer install \
/dev/mapper/mpatha \ (1)
--append-karg rd.iscsi.firmware=1 \ (2)
--append-karg rd.multipath=default \ (3)
--console ttyS0 \
--ignition-file <path_to_file>
| 1 |
The path of a single multipathed device. If there are multiple multipath devices connected, or to be explicit, you can use the World Wide Name (WWN) symlink available in /dev/disk/by-path. |
| 2 |
The iSCSI parameter is read from the BIOS firmware. |
| 3 |
Optional: include this parameter if you are enabling multipathing. |
-
Unmount the iSCSI disk:
$ iscsiadm --mode node --logout=all
This procedure can also be performed using the coreos-installer iso customize or coreos-installer pxe customize subcommands.