- Installing a cluster quickly on oVirt
- Prerequisites
- Requirements for the oVirt environment
- Verifying the requirements for the oVirt environment
- Preparing the network environment on oVirt
- Setting up the CA certificate for oVirt
- Generating an SSH private key and adding it to the agent
- Obtaining the installation program
- Deploying the cluster
- Installing the OpenShift CLI by downloading the binary
- Logging in to the cluster by using the CLI
- Verifying cluster status
- Accessing the OKD web console on oVirt
- Troubleshooting common issues with installing on oVirt
- Post-installation tasks
Installing a cluster quickly on oVirt
You can quickly install a default, non-customized, OKD cluster on a oVirt cluster, similar to the one shown in the following diagram.
The installation program uses installer-provisioned infrastructure to automate creating and deploying the cluster.
To install a default cluster, you prepare the environment, run the installation program and answer its prompts. Then, the installation program creates the OKD cluster.
For an alternative to installing a default cluster, see Installing a cluster with customizations.
This installation program is available for Linux and macOS only. |
Prerequisites
Review details about the OKD installation and update processes.
If you use a firewall, configure it to allow the sites that your cluster requires access to.
Requirements for the oVirt environment
To install and run an OKD cluster, the oVirt environment must meet the following requirements.
Not meeting these requirements can cause the installation or process to fail. Additionally, not meeting these requirements can cause the OKD cluster to fail days or weeks after installation.
The following requirements for CPU, memory, and storage resources are based on default values multiplied by the default number of virtual machines the installation program creates. These resources must be available in addition to what the oVirt environment uses for non-OKD operations.
By default, the installation program creates seven virtual machines during the installation process. First, it creates a bootstrap virtual machine to provide temporary services and a control plane while it creates the rest of the OKD cluster. When the installation program finishes creating the cluster, deleting the bootstrap machine frees up its resources.
If you increase the number of virtual machines in the oVirt environment, you must increase the resources accordingly.
Requirements
The oVirt environment has one data center whose state is Up.
The oVirt data center contains an oVirt cluster.
The oVirt cluster has the following resources exclusively for the OKD cluster:
Minimum 28 vCPUs: four for each of the seven virtual machines created during installation.
112 GiB RAM or more, including:
16 GiB or more for the bootstrap machine, which provides the temporary control plane.
16 GiB or more for each of the three control plane machines which provide the control plane.
16 GiB or more for each of the three compute machines, which run the application workloads.
The oVirt storage domain must meet these etcd backend performance requirements.
In production environments, each virtual machine must have 120 GiB or more. Therefore, the storage domain must provide 840 GiB or more for the default OKD cluster. In resource-constrained or non-production environments, each virtual machine must have 32 GiB or more, so the storage domain must have 230 GiB or more for the default OKD cluster.
To download images from the Red Hat Ecosystem Catalog during installation and update procedures, the oVirt cluster must have access to an internet connection. The Telemetry service also needs an internet connection to simplify the subscription and entitlement process.
The oVirt cluster must have a virtual network with access to the REST API on the oVirt Engine. Ensure that DHCP is enabled on this network, because the VMs that the installer creates obtain their IP address by using DHCP.
A user account and group with the following least privileges for installing and managing an OKD cluster on the target oVirt cluster:
DiskOperator
DiskCreator
UserTemplateBasedVm
TemplateOwner
TemplateCreator
ClusterAdmin
on the target cluster
Apply the principle of least privilege: Avoid using an administrator account with |
Verifying the requirements for the oVirt environment
Verify that the oVirt environment meets the requirements to install and run an OKD cluster. Not meeting these requirements can cause failures.
These requirements are based on the default resources the installation program uses to create control plane and compute machines. These resources include vCPUs, memory, and storage. If you change these resources or increase the number of OKD machines, adjust these requirements accordingly. |
Procedure
Check the oVirt version.
In the oVirt Administration Portal, click the ? help icon in the upper-right corner and select About.
In the window that opens, make a note of the oVirt Software Version.
Confirm that version 4.6 of OKD and the version of oVirt you noted are one of the supported combinations in the Support Matrix for OKD on oVirt.
Inspect the data center, cluster, and storage.
In the oVirt Administration Portal, click Compute → Data Centers.
Confirm that the data center where you plan to install OKD is accessible.
Click the name of that data center.
In the data center details, on the Storage tab, confirm the storage domain where you plan to install OKD is Active.
Record the Domain Name for use later on.
Confirm Free Space has at least 230 GiB.
Confirm that the storage domain meets these etcd backend performance requirements, which you can measure by using the fio performance benchmarking tool.
In the data center details, click the Clusters tab.
Find the oVirt cluster where you plan to install OKD. Record the cluster name for use later on.
Inspect the oVirt host resources.
In the oVirt Administration Portal, click Compute > Clusters.
Click the cluster where you plan to install OKD.
In the cluster details, click the Hosts tab.
Inspect the hosts and confirm they have a combined total of at least 28 Logical CPU Cores available exclusively for the OKD cluster.
Record the number of available Logical CPU Cores for use later on.
Confirm that these CPU cores are distributed so that each of the seven virtual machines created during installation can have four cores.
Confirm that, all together, the hosts have 112 GiB of Max free Memory for scheduling new virtual machines distributed to meet the requirements for each of the following OKD machines:
16 GiB required for the bootstrap machine
16 GiB required for each of the three control plane machines
16 GiB for each of the three compute machines
Record the amount of Max free Memory for scheduling new virtual machines for use later on.
Verify that the virtual network for installing OKD has access to the oVirt Engine’s REST API. From a virtual machine on this network, use curl to reach the oVirt Engine’s REST API:
$ curl -k -u <username>@<profile>:<password> \ (1)
https://<engine-fqdn>/ovirt-engine/api (2)
1 For <username>
, specify the user name of an oVirt account with privileges to create and manage an OKD cluster on oVirt. For<profile>
, specify the login profile, which you can get by going to the oVirt Administration Portal login page and reviewing the Profile dropdown list. For<password>
, specify the password for that user name.2 For <engine-fqdn>
, specify the fully qualified domain name of the oVirt environment.For example:
$ curl -k -u ocpadmin@internal:pw123 \
https://ovirtlab.example.com/ovirt-engine/api
Preparing the network environment on oVirt
Configure two static IP addresses for the OKD cluster and create DNS entries using these addresses.
Procedure
Reserve two static IP addresses
On the network where you plan to install OKD, identify two static IP addresses that are outside the DHCP lease pool.
Connect to a host on this network and verify that each of the IP addresses is not in use. For example, use Address Resolution Protocol (ARP) to check that none of the IP addresses have entries:
$ arp 10.35.1.19
Example output
10.35.1.19 (10.35.1.19) -- no entry
Reserve two static IP addresses following the standard practices for your network environment.
Record these IP addresses for future reference.
Create DNS entries for the OKD REST API and apps domain names using this format:
api.<cluster-name>.<base-domain> <ip-address> (1)
*.apps.<cluster-name>.<base-domain> <ip-address> (2)
1 For <cluster-name>
,<base-domain>
, and<ip-address>
, specify the cluster name, base domain, and static IP address of your OKD API.2 Specify the cluster name, base domain, and static IP address of your OKD apps for Ingress and the load balancer. For example:
api.my-cluster.virtlab.example.com 10.35.1.19
*.apps.my-cluster.virtlab.example.com 10.35.1.20
Setting up the CA certificate for oVirt
Download the CA certificate from the oVirt Manager and set it up on the installation machine.
You can download the certificate from a webpage on the oVirt Engine or by using a curl
command.
Later, you provide the certificate to the installation program.
Procedure
Use either of these two methods to download the CA certificate:
Go to the Engine’s webpage,
https://<engine-fqdn>/ovirt-engine/
. Then, under Downloads, click the CA Certificate link.Run the following command:
$ curl -k 'https://<engine-fqdn>/ovirt-engine/services/pki-resource?resource=ca-certificate&format=X509-PEM-CA' -o /tmp/ca.pem (1)
1 For <engine-fqdn>
, specify the fully qualified domain name of the oVirt Engine, such asrhv-env.virtlab.example.com
.
Configure the CA file to grant rootless user access to the Engine. Set the CA file permissions to have an octal value of
0644
(symbolic value:-rw-r—r--
):$ sudo chmod 0644 /tmp/ca.pem
For Linux, copy the CA certificate to the directory for server certificates. Use
-p
to preserve the permissions:$ sudo cp -p /tmp/ca.pem /etc/pki/ca-trust/source/anchors/ca.pem
Add the certificate to the certificate manager for your operating system:
For macOS, double-click the certificate file and use the Keychain Access utility to add the file to the System keychain.
For Linux, update the CA trust:
$ sudo update-ca-trust
If you use your own certificate authority, make sure the system trusts it.
Additional Resources
To learn more, see Authentication and Security in the oVirt documentation.
Generating an SSH private key and adding it to the agent
If you want to perform installation debugging or disaster recovery on your cluster, you must provide an SSH key to both your ssh-agent
and the installation program. You can use this key to access the bootstrap machine in a public cluster to troubleshoot installation issues.
In a production environment, you require disaster recovery and debugging. |
You can use this key to SSH into the master nodes as the user core
. When you deploy the cluster, the key is added to the core
user’s ~/.ssh/authorized_keys
list.
On clusters running Fedora CoreOS (FCOS), the SSH keys specified in the Ignition config files are written to the |
Procedure
If you do not have an SSH key that is configured for password-less authentication on your computer, create one. For example, on a computer that uses a Linux operating system, run the following command:
$ ssh-keygen -t ed25519 -N '' \
-f <path>/<file_name> (1)
1 Specify the path and file name, such as ~/.ssh/id_rsa
, of the new SSH key. If you have an existing key pair, ensure your public key is in the your~/.ssh
directory.Running this command generates an SSH key that does not require a password in the location that you specified.
If you plan to install an OKD cluster that uses FIPS Validated / Modules in Process cryptographic libraries on the
x86_64
architecture, do not create a key that uses theed25519
algorithm. Instead, create a key that uses thersa
orecdsa
algorithm.Start the
ssh-agent
process as a background task:$ eval "$(ssh-agent -s)"
Example output
Agent pid 31874
If your cluster is in FIPS mode, only use FIPS-compliant algorithms to generate the SSH key. The key must be either RSA or ECDSA.
Add your SSH private key to the
ssh-agent
:$ ssh-add <path>/<file_name> (1)
Example output
Identity added: /home/<you>/<path>/<file_name> (<computer_name>)
1 Specify the path and file name for your SSH private key, such as ~/.ssh/id_rsa
Next steps
- When you install OKD, provide the SSH public key to the installation program.
Obtaining the installation program
Before you install OKD, download the installation file on a local computer.
Prerequisites
- You have a computer that runs Linux or macOS, with 500 MB of local disk space
Procedure
Download installer from https://github.com/openshift/okd/releases
The installation program creates several files on the computer that you use to install your cluster. You must keep the installation program and the files that the installation program creates after you finish installing the cluster. Both files are required to delete the cluster.
Deleting the files created by the installation program does not remove your cluster, even if the cluster failed during installation. To remove your cluster, complete the OKD uninstallation procedures for your specific cloud provider.
Extract the installation program. For example, on a computer that uses a Linux operating system, run the following command:
$ tar xvf openshift-install-linux.tar.gz
From the Pull Secret page on the Red Hat OpenShift Cluster Manager site, download your installation pull secret as a
.txt
file. This pull secret allows you to authenticate with the services that are provided by the included authorities, including Quay.io, which serves the container images for OKD components.Using a pull secret from the Red Hat OpenShift Cluster Manager site is not required. You can use a pull secret for another private registry. Or, if you do not need the cluster to pull images from a private registry, you can use
{"auths":{"fake":{"auth":"aWQ6cGFzcwo="}}}
as the pull secret when prompted during the installation.If you do not use the pull secret from the Red Hat OpenShift Cluster Manager site:
Red Hat Operators are not available.
The Telemetry and Insights operators do not send data to Red Hat.
Content from the Red Hat Container Catalog registry, such as image streams and Operators, are not available.
Deploying the cluster
You can install OKD on a compatible cloud platform.
You can run the |
Prerequisites
Open the
ovirt-imageio
port to the Engine from the machine running the installer. By default, the port is54322
.Obtain the OKD installation program and the pull secret for your cluster.
Procedure
Change to the directory that contains the installation program and initialize the cluster deployment:
$ ./openshift-install create cluster --dir=<installation_directory> \ (1)
--log-level=info (2)
1 For <installation_directory>
, specify the directory name to store the files that the installation program creates.2 To view different installation details, specify warn
,debug
, orerror
instead ofinfo
.Specify an empty directory. Some installation assets, like bootstrap X.509 certificates have short expiration intervals, so you must not reuse an installation directory. If you want to reuse individual files from another cluster installation, you can copy them into your directory. However, the file names for the installation assets might change between releases. Use caution when copying installation files from an earlier OKD version.
Respond to the installation program prompts.
Optional: For
SSH Public Key
, select a password-less public key, such as~/.ssh/id_rsa.pub
. This key authenticates connections with the new OKD cluster.For production OKD clusters on which you want to perform installation debugging or disaster recovery, select an SSH key that your
ssh-agent
process uses.For
Platform
, selectovirt
.For
Engine FQDN[:PORT]
, enter the fully qualified domain name (FQDN) of the oVirt environment.For example:
$ curl -k -u ocpadmin@internal:pw123 \
https://ovirtlab.example.com/ovirt-engine/api
The installer automatically generates a CA certificate. For
Would you like to use the above certificate to connect to the Engine?
, answery
orN
. If you answerN
, you must install OKD in insecure mode.For
Engine username
, enter the user name and profile of the oVirt administrator using this format:<username>@<profile> (1)
1 For <username>
, specify the user name of an oVirt administrator. For<profile>
, specify the login profile, which you can get by going to the oVirt Administration Portal login page and reviewing the Profile dropdown list. For example:admin@internal
.For
Engine password
, enter the oVirt admin password.For
Cluster
, select the oVirt cluster for installing OKD.For
Storage domain
, select the storage domain for installing OKD.For
Network
, select a virtual network that has access to the oVirt Engine REST API.For
Internal API Virtual IP
, enter the static IP address you set aside for the cluster’s REST API.For
Ingress virtual IP
, enter the static IP address you reserved for the wildcard apps domain.For
Base Domain
, enter the base domain of the OKD cluster. If this cluster is exposed to the outside world, this must be a valid domain recognized by DNS infrastructure. For example, enter:virtlab.example.com
For
Cluster Name
, enter the name of the cluster. For example,my-cluster
. Use cluster name from the externally registered/resolvable DNS entries you created for the OKD REST API and apps domain names. The installation program also gives this name to the cluster in the oVirt environment.For
Pull Secret
, copy the pull secret from thepull-secret.txt
file you downloaded earlier and paste it here. You can also get a copy of the same pull secret from the Pull Secret page on the Red Hat OpenShift Cluster Manager site.
If the cloud provider account that you configured on your host does not have sufficient permissions to deploy the cluster, the installation process stops, and the missing permissions are displayed.
When the cluster deployment completes, directions for accessing your cluster, including a link to its web console and credentials for the
kubeadmin
user, display in your terminal.Example output
...
INFO Install complete!
INFO To access the cluster as the system:admin user when using 'oc', run 'export KUBECONFIG=/home/myuser/install_dir/auth/kubeconfig'
INFO Access the OpenShift web-console here: https://console-openshift-console.apps.mycluster.example.com
INFO Login to the console with user: "kubeadmin", and password: "4vYBz-Ee6gm-ymBZj-Wt5AL"
INFO Time elapsed: 36m22s
The cluster access and credential information also outputs to
<installation_directory>/.openshift_install.log
when an installation succeeds.The Ignition config files that the installation program generates contain certificates that expire after 24 hours, which are then renewed at that time. If the cluster is shut down before renewing the certificates and the cluster is later restarted after the 24 hours have elapsed, the cluster automatically recovers the expired certificates. The exception is that you must manually approve the pending
node-bootstrapper
certificate signing requests (CSRs) to recover kubelet certificates. See the documentation for Recovering from expired control plane certificates for more information.You must not delete the installation program or the files that the installation program creates. Both are required to delete the cluster.
You have completed the steps required to install the cluster. The remaining steps show you how to verify the cluster and troubleshoot the installation. |
Installing the OpenShift CLI by downloading the binary
You can install the OpenShift CLI (oc
) in order to interact with OKD from a command-line interface. You can install oc
on Linux, Windows, or macOS.
If you installed an earlier version of |
Installing the OpenShift CLI on Linux
You can install the OpenShift CLI (oc
) binary on Linux by using the following procedure.
Procedure
Navigate to https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/ and choose the folder for your operating system and architecture.
Download
oc.tar.gz
.Unpack the archive:
$ tar xvzf <file>
Place the
oc
binary in a directory that is on yourPATH
.To check your
PATH
, execute the following command:$ echo $PATH
After you install the OpenShift CLI, it is available using the oc
command:
$ oc <command>
Installing the OpenShift CLI on Windows
You can install the OpenShift CLI (oc
) binary on Windows by using the following procedure.
Procedure
Navigate to https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/ and choose the folder for your operating system and architecture.
Download
oc.zip
.Unzip the archive with a ZIP program.
Move the
oc
binary to a directory that is on yourPATH
.To check your
PATH
, open the command prompt and execute the following command:C:\> path
After you install the OpenShift CLI, it is available using the oc
command:
C:\> oc <command>
Installing the OpenShift CLI on macOS
You can install the OpenShift CLI (oc
) binary on macOS by using the following procedure.
Procedure
Navigate to https://mirror.openshift.com/pub/openshift-v4/clients/oc/latest/ and choose the folder for your operating system and architecture.
Download
oc.tar.gz
.Unpack and unzip the archive.
Move the
oc
binary to a directory on your PATH.To check your
PATH
, open a terminal and execute the following command:$ echo $PATH
After you install the OpenShift CLI, it is available using the oc
command:
$ oc <command>
To learn more, see Getting started with the OpenShift CLI.
Logging in to the cluster by using the CLI
You can log in to your cluster as a default system user by exporting the cluster kubeconfig
file. The kubeconfig
file contains information about the cluster that is used by the CLI to connect a client to the correct cluster and API server. The file is specific to a cluster and is created during OKD installation.
Prerequisites
You deployed an OKD cluster.
You installed the
oc
CLI.
Procedure
Export the
kubeadmin
credentials:$ export KUBECONFIG=<installation_directory>/auth/kubeconfig (1)
1 For <installation_directory>
, specify the path to the directory that you stored the installation files in.Verify you can run
oc
commands successfully using the exported configuration:$ oc whoami
Example output
system:admin
Additional resources
- See Accessing the web console for more details about accessing and understanding the OKD web console.
Verifying cluster status
You can verify your OKD cluster’s status during or after installation.
Procedure
In the cluster environment, export the administrator’s kubeconfig file:
$ export KUBECONFIG=<installation_directory>/auth/kubeconfig (1)
1 For <installation_directory>
, specify the path to the directory that you stored the installation files in.The
kubeconfig
file contains information about the cluster that is used by the CLI to connect a client to the correct cluster and API server.View the control plane and compute machines created after a deployment:
$ oc get nodes
View your cluster’s version:
$ oc get clusterversion
View your Operators’ status:
$ oc get clusteroperator
View all running pods in the cluster:
$ oc get pods -A
Troubleshooting
If the installation fails, the installation program times out and displays an error message. To learn more, see Troubleshooting installation issues.
Accessing the OKD web console on oVirt
After the OKD cluster initializes, you can log into the OKD web console.
Procedure
Optional: In the oVirt Administration Portal, open Compute → Cluster.
Verify that the installation program creates the virtual machines.
Return to the command line where the installation program is running. When the installation program finishes, it displays the user name and temporary password for logging into the OKD web console.
In a browser, open the URL of the OKD web console. The URL uses this format:
console-openshift-console.apps.<clustername>.<basedomain> (1)
1 For <clustername>.<basedomain>
, specify the cluster name and base domain.For example:
console-openshift-console.apps.my-cluster.virtlab.example.com
Additional resources
- See About remote health monitoring for more information about the Telemetry service
Troubleshooting common issues with installing on oVirt
Here are some common issues you might encounter, along with proposed causes and solutions.
CPU load increases and nodes go into a Not Ready
state
Symptom: CPU load increases significantly and nodes start going into a
Not Ready
state.Cause: The storage domain latency might be too high, especially for control plane nodes (also known as the master nodes).
Solution:
Make the nodes ready again by restarting the kubelet service:
$ systemctl restart kubelet
Inspect the OKD metrics service, which automatically gathers and reports on some valuable data such as the etcd disk sync duration. If the cluster is operational, use this data to help determine whether storage latency or throughput is the root issue. If so, consider using a storage resource that has lower latency and higher throughput.
To get raw metrics, enter the following command as kubeadmin or user with cluster-admin privileges:
$ oc get --insecure-skip-tls-verify --server=https://localhost:<port> --raw=/metrics
To learn more, see Exploring Application Endpoints for the purposes of Debugging with OpenShift 4.x
Trouble connecting the OKD cluster API
Symptom: The installation program completes but the OKD cluster API is not available. The bootstrap virtual machine remains up after the bootstrap process is complete. When you enter the following command, the response will time out.
$ oc login -u kubeadmin -p *** <apiurl>
Cause: The bootstrap VM was not deleted by the installation program and has not released the cluster’s API IP address.
Solution: Use the
wait-for
subcommand to be notified when the bootstrap process is complete:$ ./openshift-install wait-for bootstrap-complete
When the bootstrap process is complete, delete the bootstrap virtual machine:
$ ./openshift-install destroy bootstrap
Post-installation tasks
After the OKD cluster initializes, you can perform the following tasks.
Optional: After deployment, add or replace SSH keys using the Machine Config Operator (MCO) in OKD.
Optional: Remove the
kubeadmin
user. Instead, use the authentication provider to create a user with cluster-admin privileges.