Este conteúdo não está disponível no idioma selecionado.
Chapter 3. Installing an OpenShift Container Platform cluster with the Agent-based Installer
3.1. Prerequisites Copiar o linkLink copiado para a área de transferência!
- 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.
3.2. Installing OpenShift Container Platform with the Agent-based Installer Copiar o linkLink copiado para a área de transferência!
The following procedure deploys a single-node OpenShift Container Platform in a disconnected environment. You can use this procedure as a basis and modify according to your requirements.
Procedure
- Log in to the OpenShift Container Platform web console using your login credentials.
Navigate to Datacenter.
- Click Run Agent-based Installer locally. You are directed to the Install OpenShift Container Platform on Bare Metal locally with Agent page.
Optional: Alternatively, you can also click Bare Metal (x86_64) on the Select an OpenShift Container Platform cluster type to create page. You are directed to the Create an OpenShift Container Platform Cluster: Bare Metal page. Then, select Local Agent-based to go to the Install OpenShift Container Platform on Bare Metal locally with Agent page.
- Select the operating system and architecture.
- 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-installbinary in a directory that is on yourPATH. Install
nmstatedependency by running the following command:sudo dnf install /usr/bin/nmstatectl -y
$ sudo dnf install /usr/bin/nmstatectl -yCopy to Clipboard Copied! Toggle word wrap Toggle overflow -
Place the
openshift-installbinary 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 NoteThis is the preferred method for the Agent-based installation. Using ZTP manifests is optional.
Create the
install-config.yamlfile:Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteIf you set the platform to
vSphere,none, orbaremetal, 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 Create the
agent-config.yamlfile: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-servicecomponent. You must provide the rendezvous IP address when you do not specify at least one host’s IP address in thenetworkConfigparameter. If this address is not provided, one IP address is selected from the provided hosts'networkConfig. - 2
- Host configuration is optional. The number of hosts defined must not exceed the total number of hosts defined in the
install-config.yamlfile, which is the sum of the values of thecompute.replicasandcontrolPlane.replicasparameters. - 3
- The optional
hostnameparameter 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
- The
rootDeviceHintsparameter enables provisioning of the Red Hat Enterprise Linux CoreOS (RHCOS) image to a particular device. It 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
- Set this optional parameter to configure the network interface of a host in NMState format.
Create the agent image by running the following command:
openshift-install --dir <install_directory> agent create image
$ openshift-install --dir <install_directory> agent create imageCopy 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.confconfiguration.-
Boot the
agent.x86_64.isoimage on the bare metal machines. Optional: To know when the bootstrap host (which is the 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=info2 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 completeCopy 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 sucessful installation, run the following command:
openshift-install --dir <install_directory> agent wait-for install-complete
$ openshift-install --dir <install_directory> agent wait-for install-complete1 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 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)
Example of dual-stack networking
IPv6 is supported only on bare metal platforms.
3.3. Gathering log data from a failed Agent-based installation Copiar o linkLink copiado para a área de transferência!
Use the following procedure to gather log data about a failed Agent-based installation to provide for a support case.
Procedure
Run the following command and collect the output:
./openshift-install --dir <install_directory> agent wait-for bootstrap-complete --log-level=debug
$ ./openshift-install --dir <install_directory> agent wait-for bootstrap-complete --log-level=debugCopy 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 exceededCopy 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 on node 0 and collect the output:
ssh core@<node-ip> sudo /usr/local/bin/agent-gather -O > <local_tmp_path>/agent-gather.tar.xz
$ ssh core@<node-ip> sudo /usr/local/bin/agent-gather -O > <local_tmp_path>/agent-gather.tar.xzCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteYou only need to gather data from node 0, but gathering this data from every node can 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=debugCopy to Clipboard Copied! Toggle word wrap Toggle overflow If the output from the previous command indicates a failure, perform the following steps:
Export the
kubeconfigfile to your environment by running the following command:export KUBECONFIG=<install_directory>/auth/kubeconfig
$ export KUBECONFIG=<install_directory>/auth/kubeconfigCopy to Clipboard Copied! Toggle word wrap Toggle overflow To gather information for debugging, run the following command:
oc adm must-gather
$ oc adm must-gatherCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create a compressed file from the
must-gatherdirectory 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
/authsubdirectory, 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.
3.4. Sample ZTP custom resources Copiar o linkLink copiado para a área de transferência!
Optional: You can use 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 ZTP custom resources to specify more details about your OpenShift Container Platform cluster. The following sample ZTP custom resources are for a single-node cluster.
agent-cluster-install.yaml
cluster-deployment.yaml
cluster-image-set.yaml
infra-env.yaml
nmstateconfig.yaml
pull-secret.yaml