此内容没有您所选择的语言版本。
Chapter 4. Installing a cluster with customizations
Use the following procedures to install an OpenShift Container Platform cluster with customizations using the Agent-based Installer.
4.1. Prerequisites 复制链接链接已复制到粘贴板!
- You reviewed details about the OpenShift Container Platform installation and update processes.
- You read the documentation on selecting a cluster installation method and preparing it for users.
- If you use a firewall or proxy, you configured it to allow the sites that your cluster requires access to.
The following procedures deploy a single-node OpenShift Container Platform in a disconnected environment. You can use these procedures as a basis and modify according to your requirements.
4.2.1. Downloading the Agent-based Installer 复制链接链接已复制到粘贴板!
Use this procedure to download the Agent-based Installer and the CLI needed for your installation.
Procedure
- Log in to the OpenShift Container Platform 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.
- 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 yourPATH
.
Before installing an OpenShift Container Platform cluster using the Agent-based Installer, you can verify the supported architecture on which you can install the cluster. This procedure is optional.
Prerequisites
-
You installed the OpenShift CLI (
oc
). - You have downloaded the installation program.
Procedure
-
Log in to the OpenShift CLI (
oc
). Check your release payload by running the following command:
./openshift-install version
$ ./openshift-install version
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
./openshift-install 4.18.0 built from commit abc123def456 release image quay.io/openshift-release-dev/ocp-release@sha256:123abc456def789ghi012jkl345mno678pqr901stu234vwx567yz0 release architecture amd64
./openshift-install 4.18.0 built from commit abc123def456 release image quay.io/openshift-release-dev/ocp-release@sha256:123abc456def789ghi012jkl345mno678pqr901stu234vwx567yz0 release architecture amd64
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you are using the release image with the
multi
payload, therelease architecture
displayed in the output of this command is the default architecture.To check the architecture of the payload, run the following command:
oc adm release info <release_image> -o jsonpath="{ .metadata.metadata}"
$ oc adm release info <release_image> -o jsonpath="{ .metadata.metadata}"
1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Replace
<release_image>
with the release image. For example:quay.io/openshift-release-dev/ocp-release@sha256:123abc456def789ghi012jkl345mno678pqr901stu234vwx567yz0
.
Example output when the release image uses the
multi
payload{"release.openshift.io architecture":"multi"}
{"release.openshift.io architecture":"multi"}
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you are using the release image with the
multi
payload, you can install the cluster on different architectures such asarm64
,amd64
,s390x
, andppc64le
. Otherwise, you can install the cluster only on therelease architecture
displayed in the output of theopenshift-install version
command.
4.2.3. Creating the preferred configuration inputs 复制链接链接已复制到粘贴板!
Use this procedure to create the preferred configuration inputs used to create the agent image.
Configuring the install-config.yaml
and agent-config.yaml
files is the preferred method for using the Agent-based Installer. Using GitOps ZTP manifests is optional.
Procedure
Install the
nmstate
dependency by running the following command:sudo dnf install /usr/bin/nmstatectl -y
$ sudo dnf install /usr/bin/nmstatectl -y
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Place the
openshift-install
binary in a directory that is on your PATH. Create a directory to store the install configuration by running the following command:
mkdir ~/<directory_name>
$ mkdir ~/<directory_name>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create the
install-config.yaml
file by running the following command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- Specify the system architecture. Valid values are
amd64
,arm64
,ppc64le
, ands390x
.If you are using the release image with the
multi
payload, you can install the cluster on different architectures such asarm64
,amd64
,s390x
, andppc64le
. Otherwise, you can install the cluster only on therelease architecture
displayed in the output of theopenshift-install version
command. For more information, see "Verifying the supported architecture for installing an Agent-based Installer cluster". - 2
- Required. Specify your cluster name.
- 3
- The cluster network plugin to install. The default value
OVNKubernetes
is the only supported value. - 4
- Specify your platform.Note
For bare-metal platforms, host settings made in the platform section of the
install-config.yaml
file are used by default, unless they are overridden by configurations made in theagent-config.yaml
file. - 5
- Specify your pull secret.
- 6
- Specify your SSH public key.
NoteIf you set the platform to
vSphere
,baremetal
, ornone
, you can configure IP address endpoints for cluster nodes in three ways:- IPv4
- IPv6
- IPv4 and IPv6 in parallel (dual-stack)
Example of dual-stack networking
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteWhen you use a disconnected mirror registry, you must add the certificate file that you created previously for your mirror registry to the
additionalTrustBundle
field of theinstall-config.yaml
file.Create the
agent-config.yaml
file by running the following command:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- This IP address is used to determine which node performs the bootstrapping process as well as running the
assisted-service
component. You must provide the rendezvous IP address when you do not specify at least one host’s IP address in thenetworkConfig
parameter. If this address is not provided, one IP address is selected from the provided hosts'networkConfig
. - 2
- Optional: Host configuration. The number of hosts defined must not exceed the total number of hosts defined in the
install-config.yaml
file, which is the sum of the values of thecompute.replicas
andcontrolPlane.replicas
parameters. - 3
- Optional: Overrides the hostname obtained from either the Dynamic Host Configuration Protocol (DHCP) or a reverse DNS lookup. Each host must have a unique hostname supplied by one of these methods.
- 4
- Enables provisioning of the Red Hat Enterprise Linux CoreOS (RHCOS) image to a particular device. The installation program examines the devices in the order it discovers them, and compares the discovered values with the hint values. It uses the first discovered device that matches the hint value.
- 5
- Optional: Configures the network interface of a host in NMState format.
4.2.4. Creating additional manifest files 复制链接链接已复制到粘贴板!
As an optional task, you can create additional manifests to further configure your cluster beyond the configurations available in the install-config.yaml
and agent-config.yaml
files.
Customizations to the cluster made by additional manifests are not validated, are not guaranteed to work, and might result in a nonfunctional cluster.
If you create additional manifests to configure your Agent-based installation beyond the install-config.yaml
and agent-config.yaml
files, you must create an openshift
subdirectory within your installation directory. All of your additional machine configurations must be located within this subdirectory.
The most common type of additional manifest you can add is a MachineConfig
object. For examples of MachineConfig
objects you can add during the Agent-based installation, see "Using MachineConfig objects to configure nodes" in the "Additional resources" section.
Procedure
On your installation host, create an
openshift
subdirectory within the installation directory by running the following command:mkdir <installation_directory>/openshift
$ mkdir <installation_directory>/openshift
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.2.4.2. Disk partitioning 复制链接链接已复制到粘贴板!
In general, you should use the default disk partitioning that is created during the RHCOS installation. However, there are cases where you might want to create a separate partition for a directory that you expect to grow.
OpenShift Container Platform supports the addition of a single partition to attach storage to either the /var
directory or a subdirectory of /var
. For example:
-
/var/lib/containers
: Holds container-related content that can grow as more images and containers are added to a system. -
/var/lib/etcd
: Holds data that you might want to keep separate for purposes such as performance optimization of etcd storage. /var
: Holds data that you might want to keep separate for purposes such as auditing.ImportantFor disk sizes larger than 100GB, and especially larger than 1TB, create a separate
/var
partition.
Storing the contents of a /var
directory separately makes it easier to grow storage for those areas as needed and reinstall OpenShift Container Platform at a later date and keep that data intact. With this method, you will not have to pull all your containers again, nor will you have to copy massive log files when you update systems.
The use of a separate partition for the /var
directory or a subdirectory of /var
also prevents data growth in the partitioned directory from filling up the root file system.
The following procedure sets up a separate /var
partition by adding a machine config manifest that is wrapped into the Ignition config file for a node type during the preparation phase of an installation.
Prerequisites
-
You have created an
openshift
subdirectory within your installation directory.
Procedure
Create a Butane config that configures the additional partition. For example, name the file
$HOME/clusterconfig/98-var-partition.bu
, change the disk device name to the name of the storage device on theworker
systems, and set the storage size as appropriate. This example places the/var
directory on a separate partition:Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The storage device name of the disk that you want to partition.
- 2
- When adding a data partition to the boot disk, a minimum offset value of 25000 mebibytes is recommended. The root file system is automatically resized to fill all available space up to the specified offset. If no offset value is specified, or if the specified value is smaller than the recommended minimum, the resulting root file system will be too small, and future reinstalls of RHCOS might overwrite the beginning of the data partition.
- 3
- The size of the data partition in mebibytes.
- 4
- The
prjquota
mount option must be enabled for filesystems used for container storage.
NoteWhen creating a separate
/var
partition, you cannot use different instance types for compute nodes, if the different instance types do not have the same device name.Create a manifest from the Butane config and save it to the
clusterconfig/openshift
directory. For example, run the following command:butane $HOME/clusterconfig/98-var-partition.bu -o $HOME/clusterconfig/openshift/98-var-partition.yaml
$ butane $HOME/clusterconfig/98-var-partition.bu -o $HOME/clusterconfig/openshift/98-var-partition.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.2.5. Using ZTP manifests 复制链接链接已复制到粘贴板!
As an optional task, you can use GitOps Zero Touch Provisioning (ZTP) manifests to configure your installation beyond the options available through the install-config.yaml
and agent-config.yaml
files.
GitOps ZTP manifests can be generated with or without configuring the install-config.yaml
and agent-config.yaml
files beforehand. If you chose to configure the install-config.yaml
and agent-config.yaml
files, the configurations will be imported to the ZTP cluster manifests when they are generated.
Prerequisites
-
You have placed the
openshift-install
binary in a directory that is on yourPATH
. -
Optional: You have created and configured the
install-config.yaml
andagent-config.yaml
files.
Procedure
Generate ZTP cluster manifests by running the following command:
openshift-install agent create cluster-manifests --dir <installation_directory>
$ openshift-install agent create cluster-manifests --dir <installation_directory>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantIf you have created the
install-config.yaml
andagent-config.yaml
files, those files are deleted and replaced by the cluster manifests generated through this command.Any configurations made to the
install-config.yaml
andagent-config.yaml
files are imported to the ZTP cluster manifests when you run theopenshift-install agent create cluster-manifests
command.Navigate to the
cluster-manifests
directory by running the following command:cd <installation_directory>/cluster-manifests
$ cd <installation_directory>/cluster-manifests
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Configure the manifest files in the
cluster-manifests
directory. For sample files, see the "Sample GitOps ZTP custom resources" section. Disconnected clusters: If you did not define mirror configuration in the
install-config.yaml
file before generating the ZTP manifests, perform the following steps:Navigate to the
mirror
directory by running the following command:cd ../mirror
$ cd ../mirror
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Configure the manifest files in the
mirror
directory.
4.2.6. Encrypting the disk 复制链接链接已复制到粘贴板!
As an optional task, you can use this procedure to encrypt your disk or partition while installing OpenShift Container Platform with the Agent-based Installer.
If there are leftover TPM encryption keys from a previous operating system on the bare-metal host, the cluster deployment can get stuck. To avoid this situation, it is highly recommended to reset the TPM chip in the BIOS before booting the ISO.
Prerequisites
-
You have created and configured the
install-config.yaml
andagent-config.yaml
files, unless you are using ZTP manifests. -
You have placed the
openshift-install
binary in a directory that is on yourPATH
.
Procedure
Generate ZTP cluster manifests by running the following command:
openshift-install agent create cluster-manifests --dir <installation_directory>
$ openshift-install agent create cluster-manifests --dir <installation_directory>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantIf you have created the
install-config.yaml
andagent-config.yaml
files, those files are deleted and replaced by the cluster manifests generated through this command.Any configurations made to the
install-config.yaml
andagent-config.yaml
files are imported to the ZTP cluster manifests when you run theopenshift-install agent create cluster-manifests
command.NoteIf you have already generated ZTP manifests, skip this step.
Navigate to the
cluster-manifests
directory by running the following command:cd <installation_directory>/cluster-manifests
$ cd <installation_directory>/cluster-manifests
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Add the following section to the
agent-cluster-install.yaml
file:diskEncryption: enableOn: all mode: tang tangServers: "server1": "http://tang-server-1.example.com:7500"
diskEncryption: enableOn: all
1 mode: tang
2 tangServers: "server1": "http://tang-server-1.example.com:7500"
3 Copy to Clipboard Copied! Toggle word wrap Toggle overflow
4.2.7. Creating and booting the agent image 复制链接链接已复制到粘贴板!
Use this procedure to boot the agent image on your machines.
Procedure
Create the agent image by running the following command:
openshift-install --dir <install_directory> agent create image
$ openshift-install --dir <install_directory> agent create image
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteRed Hat Enterprise Linux CoreOS (RHCOS) supports multipathing on the primary disk, allowing stronger resilience to hardware failure to achieve higher host availability. Multipathing is enabled by default in the agent ISO image, with a default
/etc/multipath.conf
configuration.-
Boot the
agent.x86_64.iso
,agent.aarch64.iso
, oragent.s390x.iso
image on the bare metal machines.
4.2.8. Adding IBM Z agents with RHEL KVM 复制链接链接已复制到粘贴板!
Use the following procedure to manually add IBM Z® agents with RHEL KVM. Only use this procedure for IBM Z® clusters with RHEL KVM.
The nmstateconfig
parameter must be configured for the KVM boot.
Procedure
- Boot your RHEL KVM machine.
To deploy the virtual server, run the
virt-install
command with the following parameters:ISO boot
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- For the
--cdrom
parameter, specify the location of the ISO image on the local server, for example,<path_to_image>/home/<image>.iso
.
Optional: Enable FIPS mode.
To enable FIPS mode on IBM Z® clusters with RHEL KVM you must use PXE boot instead and run the
virt-install
command with the following parameters:PXE boot
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteCurrently, only PXE boot is supported to enable FIPS mode on IBM Z®.
After you boot the agent image and network services are made available to the host, the agent console application performs a pull check to verify that the current host can retrieve release images.
If the primary pull check passes, you can quit the application to continue with the installation. If the pull check fails, the application performs additional checks, as seen in the Additional checks
section of the TUI, to help you troubleshoot the problem. A failure for any of the additional checks is not necessarily critical as long as the primary pull check succeeds.
If there are host network configuration issues that might cause an installation to fail, you can use the console application to make adjustments to your network configurations.
If the agent console application detects host network configuration issues, the installation workflow will be halted until the user manually stops the console application and signals the intention to proceed.
Procedure
- Wait for the agent console application to check whether or not the configured release image can be pulled from a registry.
If the agent console application states that the installer connectivity checks have passed, wait for the prompt to time out to continue with the installation.
NoteYou can still choose to view or change network configuration settings even if the connectivity checks have passed.
However, if you choose to interact with the agent console application rather than letting it time out, you must manually quit the TUI to proceed with the installation.
If the agent console application checks have failed, which is indicated by a red icon beside the
Release image URL
pull check, use the following steps to reconfigure the host’s network settings:Read the
Check Errors
section of the TUI. This section displays error messages specific to the failed checks.- Select Configure network to launch the NetworkManager TUI.
- Select Edit a connection and select the connection you want to reconfigure.
- Edit the configuration and select OK to save your changes.
- Select Back to return to the main screen of the NetworkManager TUI.
- Select Activate a Connection.
- Select the reconfigured network to deactivate it.
- Select the reconfigured network again to reactivate it.
- Select Back and then select Quit to return to the agent console application.
- Wait at least five seconds for the continuous network checks to restart using the new network configuration.
-
If the
Release image URL
pull check succeeds and displays a green icon beside the URL, select Quit to exit the agent console application and continue with the installation.
4.2.10. Tracking and verifying installation progress 复制链接链接已复制到粘贴板!
Use the following procedure to track installation progress and to verify a successful installation.
Prerequisites
- You have configured a DNS record for the Kubernetes API server.
Procedure
Optional: To know when the bootstrap host (rendezvous host) reboots, run the following command:
./openshift-install --dir <install_directory> agent wait-for bootstrap-complete \ --log-level=info
$ ./openshift-install --dir <install_directory> agent wait-for bootstrap-complete \
1 --log-level=info
2 Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
................................................................... ................................................................... INFO Bootstrap configMap status is complete INFO cluster bootstrap is complete
................................................................... ................................................................... INFO Bootstrap configMap status is complete INFO cluster bootstrap is complete
Copy to Clipboard Copied! Toggle word wrap Toggle overflow The command succeeds when the Kubernetes API server signals that it has been bootstrapped on the control plane machines.
To track the progress and verify successful installation, run the following command:
openshift-install --dir <install_directory> agent wait-for install-complete
$ openshift-install --dir <install_directory> agent wait-for install-complete
1 Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- For
<install_directory>
directory, specify the path to the directory where the agent ISO was generated.
Example output
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
If you are using the optional method of GitOps ZTP manifests, you can configure IP address endpoints for cluster nodes through the AgentClusterInstall.yaml
file in three ways:
- IPv4
- IPv6
- IPv4 and IPv6 in parallel (dual-stack)
IPv6 is supported only on bare metal platforms.
Example of dual-stack networking
4.3. Sample GitOps ZTP custom resources 复制链接链接已复制到粘贴板!
You can optionally use GitOps Zero Touch Provisioning (ZTP) custom resource (CR) objects to install an OpenShift Container Platform cluster with the Agent-based Installer.
You can customize the following GitOps ZTP custom resources to specify more details about your OpenShift Container Platform cluster. The following sample GitOps ZTP custom resources are for a single-node cluster.
Example agent-cluster-install.yaml
file
Example cluster-deployment.yaml
file
Example cluster-image-set.yaml
file
Example infra-env.yaml
file
Example nmstateconfig.yaml
file
Example pull-secret.yaml
file
Use the following procedure to gather log data about a failed Agent-based installation to provide for a support case.
Prerequisites
- You have configured a DNS record for the Kubernetes API server.
Procedure
Run the following command and collect the output:
./openshift-install --dir <installation_directory> agent wait-for bootstrap-complete --log-level=debug
$ ./openshift-install --dir <installation_directory> agent wait-for bootstrap-complete --log-level=debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Example error message
... ERROR Bootstrap failed to complete: : bootstrap process timed out: context deadline exceeded
... ERROR Bootstrap failed to complete: : bootstrap process timed out: context deadline exceeded
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the output from the previous command indicates a failure, or if the bootstrap is not progressing, run the following command to connect to the rendezvous host and collect the output:
ssh core@<node-ip> agent-gather -O >agent-gather.tar.xz
$ ssh core@<node-ip> agent-gather -O >agent-gather.tar.xz
Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteRed Hat Support can diagnose most issues using the data gathered from the rendezvous host, but if some hosts are not able to register, gathering this data from every host might be helpful.
If the bootstrap completes and the cluster nodes reboot, run the following command and collect the output:
./openshift-install --dir <install_directory> agent wait-for install-complete --log-level=debug
$ ./openshift-install --dir <install_directory> agent wait-for install-complete --log-level=debug
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If the output from the previous command indicates a failure, perform the following steps:
Export the
kubeconfig
file to your environment by running the following command:export KUBECONFIG=<install_directory>/auth/kubeconfig
$ export KUBECONFIG=<install_directory>/auth/kubeconfig
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Gather information for debugging by running the following command:
oc adm must-gather
$ oc adm must-gather
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a compressed file from the
must-gather
directory that was just created in your working directory by running the following command:tar cvaf must-gather.tar.gz <must_gather_directory>
$ tar cvaf must-gather.tar.gz <must_gather_directory>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
-
Excluding the
/auth
subdirectory, attach the installation directory used during the deployment to your support case on the Red Hat Customer Portal. - Attach all other data gathered from this procedure to your support case.