$ curl -k -u <username>@<profile>:<password> \ (1)
https://<engine-fqdn>/ovirt-engine/api (2)
In OKD version 4.7, you can install a customized OKD cluster on oVirt in a restricted network by creating an internal mirror of the installation release content.
The following items are required to install an OKD cluster on a oVirt environment.
You have a supported combination of versions in the Support Matrix for OKD on oVirt.
You are familiar with the OKD installation and update processes.
Create a registry on your mirror host and obtain the imageContentSources
data for your version of OKD.
Because the installation media is on the mirror host, you can use that computer to complete all installation steps. |
Provision persistent storage for your cluster. To deploy a private image registry, your storage must provide ReadWriteMany access modes.
Review details about the OKD installation and update processes.
If you use a firewall and plan to use telemetry, you must configure the firewall to allow the sites that your cluster requires access to.
Be sure to also review this site list if you are configuring a proxy. |
In OKD 4.7, you can perform an installation that does not require an active connection to the Internet to obtain software components. Restricted network installations can be completed using installer-provisioned infrastructure or user-provisioned infrastructure, depending on the cloud platform to which you are installing the cluster.
If you choose to perform a restricted network installation on a cloud platform, you still require access to its cloud APIs. Some cloud functions, like Amazon Web Service’s Route 53 DNS and IAM services, require internet access. Depending on your network, you might require less Internet access for an installation on bare metal hardware or on VMware vSphere.
To complete a restricted network installation, you must create a registry that mirrors the contents of the OKD registry and contains the installation media. You can create this registry on a mirror host, which can access both the Internet and your closed network, or by using other methods that meet your restrictions.
Clusters in restricted networks have the following additional limitations and restrictions:
The ClusterVersion
status includes an Unable to retrieve available updates
error.
By default, you cannot use the contents of the Developer Catalog because you cannot access the required image stream tags.
To install and run an OKD version 4.7 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.
The oVirt version is 4.4.
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 |
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. |
Check that the oVirt version supports installation of OKD version 4.7.
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 the oVirt version is 4.4. For more information about supported version combinations, see 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 admin@internal:pw123 \
https://ovirtlab.example.com/ovirt-engine/api
All the Fedora CoreOS (FCOS) machines require network in initramfs
during boot
to fetch Ignition config from the machine config server.
During the initial boot, the machines require either a DHCP server or that static IP addresses be set on each host in the cluster to establish a network connection, which allows them to download their Ignition config files.
It is recommended to use the DHCP server to manage the machines for the cluster long-term. Ensure that the DHCP server is configured to provide persistent IP addresses and host names to the cluster machines.
The Kubernetes API server must be able to resolve the node names of the cluster machines. If the API servers and worker nodes are in different zones, you can configure a default DNS search zone to allow the API server to resolve the node names. Another supported approach is to always refer to hosts by their fully-qualified domain names in both the node objects and all DNS requests.
You must configure the network connectivity between machines to allow cluster components to communicate. Each machine must be able to resolve the host names of all other machines in the cluster.
Configure your firewall so your cluster has access to required sites.
See also:
Configure infrastructure-provided DNS to allow the correct resolution of the main components and services. If you use only one load balancer, these DNS records can point to the same IP address.
Create DNS records for api.<cluster_name>.<base_domain>
(internal and external resolution) and api-int.<cluster_name>.<base_domain>
(internal resolution) that point to the load balancer for the control plane machines.
Create a DNS record for *.apps.<cluster_name>.<base_domain>
that points to the load balancer for the Ingress router. For example, ports 443
and 80
of the compute machines.
Protocol | Port | Description |
---|---|---|
ICMP |
N/A |
Network reachability tests |
TCP |
|
Metrics |
|
Host level services, including the node exporter on ports |
|
|
The default ports that Kubernetes reserves |
|
|
openshift-sdn |
|
UDP |
|
VXLAN and Geneve |
|
VXLAN and Geneve |
|
|
Host level services, including the node exporter on ports |
|
TCP/UDP |
|
Kubernetes node port |
Protocol | Port | Description |
---|---|---|
TCP |
|
Kubernetes API |
Protocol | Port | Description |
---|---|---|
TCP |
|
etcd server and peer ports |
The infrastructure that you provision for your cluster must meet the following network topology requirements.
OKD requires all nodes to have internet access to pull images for platform containers and provide telemetry data to Red Hat. |
Before you install OKD, you must provision two load balancers that meet the following requirements:
API load balancer: Provides a common endpoint for users, both human and machine, to interact with and configure the platform. Configure the following conditions:
Layer 4 load balancing only. This can be referred to as Raw TCP, SSL Passthrough, or SSL Bridge mode. If you use SSL Bridge mode, you must enable Server Name Indication (SNI) for the API routes.
A stateless load balancing algorithm. The options vary based on the load balancer implementation.
Do not configure session persistence for an API load balancer. |
Configure the following ports on both the front and back of the load balancers:
Port | Back-end machines (pool members) | Internal | External | Description |
---|---|---|---|---|
|
Bootstrap and control plane. You remove the bootstrap machine from the load
balancer after the bootstrap machine initializes the cluster control plane. You
must configure the |
X |
X |
Kubernetes API server |
|
Bootstrap and control plane. You remove the bootstrap machine from the load balancer after the bootstrap machine initializes the cluster control plane. |
X |
Machine config server |
The load balancer must be configured to take a maximum of 30 seconds from the
time the API server turns off the |
Application Ingress load balancer: Provides an Ingress point for application traffic flowing in from outside the cluster. Configure the following conditions:
Layer 4 load balancing only. This can be referred to as Raw TCP, SSL Passthrough, or SSL Bridge mode. If you use SSL Bridge mode, you must enable Server Name Indication (SNI) for the Ingress routes.
A connection-based or session-based persistence is recommended, based on the options available and types of applications that will be hosted on the platform.
Configure the following ports on both the front and back of the load balancers:
Port | Back-end machines (pool members) | Internal | External | Description |
---|---|---|---|---|
|
The machines that run the Ingress router pods, compute, or worker, by default. |
X |
X |
HTTPS traffic |
|
The machines that run the Ingress router pods, compute, or worker, by default. |
X |
X |
HTTP traffic |
If the true IP address of the client can be seen by the load balancer, enabling source IP-based session persistence can improve performance for applications that use end-to-end TLS encryption. |
A working configuration for the Ingress router is required for an OKD cluster. You must configure the Ingress router after the control plane initializes. |
OKD clusters are configured to use a public Network Time Protocol (NTP) server by default. If you want to use a local enterprise NTP server, or if your cluster is being deployed in a disconnected network, you can configure the cluster to use a specific time server. For more information, see the documentation for Configuring chrony time service.
If a DHCP server provides NTP server information, the chrony time service on the Fedora CoreOS (FCOS) machines read the information and can sync the clock with the NTP servers.
DNS is used for name resolution and reverse name resolution. DNS A/AAAA or CNAME records are used for name resolution and PTR records are used for reverse name resolution. The reverse records are important because Fedora CoreOS (FCOS) uses the reverse records to set the host name for all the nodes. Additionally, the reverse records are used to generate the certificate signing requests (CSR) that OKD needs to operate.
The following DNS records are required for an OKD cluster that uses
user-provisioned infrastructure. In each record, <cluster_name>
is the cluster
name and <base_domain>
is the cluster base domain that you specify in the
install-config.yaml
file. A complete DNS record takes the form: <component>.<cluster_name>.<base_domain>.
.
Component | Record | Description | |
---|---|---|---|
Kubernetes API |
|
Add a DNS A/AAAA or CNAME record, and a DNS PTR record, to identify the load balancer for the control plane machines. These records must be resolvable by both clients external to the cluster and from all the nodes within the cluster. |
|
|
Add a DNS A/AAAA or CNAME record, and a DNS PTR record, to identify the load balancer for the control plane machines. These records must be resolvable from all the nodes within the cluster.
|
||
Routes |
|
Add a wildcard DNS A/AAAA or CNAME record that refers to the load balancer that targets the machines that run the Ingress router pods, which are the worker nodes by default. These records must be resolvable by both clients external to the cluster and from all the nodes within the cluster. |
|
Bootstrap |
|
Add a DNS A/AAAA or CNAME record, and a DNS PTR record, to identify the bootstrap machine. These records must be resolvable by the nodes within the cluster. |
|
Master hosts |
|
DNS A/AAAA or CNAME records and DNS PTR records to identify each machine for the control plane nodes (also known as the master nodes). These records must be resolvable by the nodes within the cluster. |
|
Worker hosts |
|
Add DNS A/AAAA or CNAME records and DNS PTR records to identify each machine for the worker nodes. These records must be resolvable by the nodes within the cluster. |
You can use the |
The following example of a BIND zone file shows sample A records for name resolution. The purpose of the example is to show the records that are needed. The example is not meant to provide advice for choosing one name resolution service over another.
$TTL 1W
@ IN SOA ns1.example.com. root (
2019070700 ; serial
3H ; refresh (3 hours)
30M ; retry (30 minutes)
2W ; expiry (2 weeks)
1W ) ; minimum (1 week)
IN NS ns1.example.com.
IN MX 10 smtp.example.com.
;
;
ns1 IN A 192.168.1.5
smtp IN A 192.168.1.5
;
helper IN A 192.168.1.5
helper.ocp4 IN A 192.168.1.5
;
; The api identifies the IP of your load balancer.
api.ocp4 IN A 192.168.1.5
api-int.ocp4 IN A 192.168.1.5
;
; The wildcard also identifies the load balancer.
*.apps.ocp4 IN A 192.168.1.5
;
; Create an entry for the bootstrap host.
bootstrap.ocp4 IN A 192.168.1.96
;
; Create entries for the master hosts.
master0.ocp4 IN A 192.168.1.97
master1.ocp4 IN A 192.168.1.98
master2.ocp4 IN A 192.168.1.99
;
; Create entries for the worker hosts.
worker0.ocp4 IN A 192.168.1.11
worker1.ocp4 IN A 192.168.1.7
;
;EOF
The following example BIND zone file shows sample PTR records for reverse name resolution.
$TTL 1W
@ IN SOA ns1.example.com. root (
2019070700 ; serial
3H ; refresh (3 hours)
30M ; retry (30 minutes)
2W ; expiry (2 weeks)
1W ) ; minimum (1 week)
IN NS ns1.example.com.
;
; The syntax is "last octet" and the host must have an FQDN
; with a trailing dot.
97 IN PTR master0.ocp4.example.com.
98 IN PTR master1.ocp4.example.com.
99 IN PTR master2.ocp4.example.com.
;
96 IN PTR bootstrap.ocp4.example.com.
;
5 IN PTR api.ocp4.example.com.
5 IN PTR api-int.ocp4.example.com.
;
11 IN PTR worker0.ocp4.example.com.
7 IN PTR worker1.ocp4.example.com.
;
;EOF
For clusters using installer-provisioned infrastructure, only the DNS records must be added. |
To run the binary openshift-install
installation program and Ansible scripts, set up the oVirt Engine or an Fedora computer with network access to the oVirt environment and the REST API on the Engine.
Update or install Python3 and Ansible. For example:
# dnf update python3 ansible
Install the python3-ovirt-engine-sdk4
package to get the Python Software Development Kit.
Install the ovirt.image-template
Ansible role. On the oVirt Engine and other Fedora machines, this role is distributed as the ovirt-ansible-image-template
package. For example, enter:
# dnf install ovirt-ansible-image-template
Install the ovirt.vm-infra
Ansible role. On the oVirt Engine and other Fedora machines, this role is distributed as the ovirt-ansible-vm-infra
package.
# dnf install ovirt-ansible-vm-infra
Create an environment variable and assign an absolute or relative path to it. For example, enter:
$ export ASSETS_DIR=./wrk
The installation program uses this variable to create a directory where it saves important installation-related files. Later, the installation process reuses this variable to locate those asset files. Avoid deleting this assets directory; it is required for uninstalling the cluster. |
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.
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 as rhv-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. |
To learn more, see Authentication and Security in the oVirt documentation.
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.
You must use a local key, not one that you configured with platform-specific approaches such as AWS key pairs. |
On clusters running Fedora CoreOS (FCOS), the SSH keys specified in the Ignition config files are written to the |
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 |
Start the ssh-agent
process as a background task:
$ eval "$(ssh-agent -s)"
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)
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 |
When you install OKD, provide the SSH public key to the installation program.
Download the Ansible playbooks for installing OKD version 4.7 on oVirt.
On your installation machine, run the following commands:
$ mkdir playbooks
$ cd playbooks
$ curl -s -L -X GET https://api.github.com/repos/openshift/installer/contents/upi/ovirt?ref=release-<version> |
grep 'download_url.*\.yml' |
awk '{ print $2 }' | sed -r 's/("|",)//g' |
xargs -n 1 curl -O
where:
Specifies the minor release version, such as release-4.8
. See the branch drop-down list in the openshift/installer
repository for the available minor versions.
After you download these Ansible playbooks, you must also create the environment variable for the assets directory and customize the inventory.yml
file before you create an installation configuration file by running the installation program.
You use the inventory.yml
file to define and create elements of the OKD cluster you are installing. This includes elements such as the Fedora CoreOS (FCOS) image, virtual machine templates, bootstrap machine, control plane nodes, and worker nodes. You also use inventory.yml
to destroy the cluster.
The following inventory.yml
example shows you the parameters and their default values. The quantities and numbers in these default values meet the requirements for running a production OKD cluster in a oVirt environment.
inventory.yml
file---
all:
vars:
ovirt_cluster: "Default"
ocp:
assets_dir: "{{ lookup('env', 'ASSETS_DIR') }}"
ovirt_config_path: "{{ lookup('env', 'HOME') }}/.ovirt/ovirt-config.yaml"
# ---
# {op-system} section
# ---
rhcos:
image_url: "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.7/latest/rhcos-openstack.x86_64.qcow2.gz"
local_cmp_image_path: "/tmp/rhcos.qcow2.gz"
local_image_path: "/tmp/rhcos.qcow2"
# ---
# Profiles section
# ---
control_plane:
cluster: "{{ ovirt_cluster }}"
memory: 16GiB
sockets: 4
cores: 1
template: rhcos_tpl
operating_system: "rhcos_x64"
type: high_performance
graphical_console:
headless_mode: false
protocol:
- spice
- vnc
disks:
- size: 120GiB
name: os
interface: virtio_scsi
storage_domain: depot_nvme
nics:
- name: nic1
network: lab
profile: lab
compute:
cluster: "{{ ovirt_cluster }}"
memory: 16GiB
sockets: 4
cores: 1
template: worker_rhcos_tpl
operating_system: "rhcos_x64"
type: high_performance
graphical_console:
headless_mode: false
protocol:
- spice
- vnc
disks:
- size: 120GiB
name: os
interface: virtio_scsi
storage_domain: depot_nvme
nics:
- name: nic1
network: lab
profile: lab
# ---
# Virtual machines section
# ---
vms:
- name: "{{ metadata.infraID }}-bootstrap"
ocp_type: bootstrap
profile: "{{ control_plane }}"
type: server
- name: "{{ metadata.infraID }}-master0"
ocp_type: master
profile: "{{ control_plane }}"
- name: "{{ metadata.infraID }}-master1"
ocp_type: master
profile: "{{ control_plane }}"
- name: "{{ metadata.infraID }}-master2"
ocp_type: master
profile: "{{ control_plane }}"
- name: "{{ metadata.infraID }}-worker0"
ocp_type: worker
profile: "{{ compute }}"
- name: "{{ metadata.infraID }}-worker1"
ocp_type: worker
profile: "{{ compute }}"
- name: "{{ metadata.infraID }}-worker2"
ocp_type: worker
profile: "{{ compute }}"
Enter values for parameters whose descriptions begin with "Enter." Otherwise, you can use the default value or replace it with a new value. |
ovirt_cluster
: Enter the name of an existing oVirt cluster in which to install the OKD cluster.
ocp.assets_dir
: The path of a directory the openshift-install
installation program creates to store the files that it generates.
ocp.ovirt_config_path
: The path of the ovirt-config.yaml
file the installation program generates, for example, ./wrk/install-config.yaml
. This file contains the credentials required to interact with the REST API of the Engine.
image_url
: Enter the URL of the FCOS image you specified for download.
local_cmp_image_path
: The path of a local download directory for the compressed FCOS image.
local_image_path
: The path of a local directory for the extracted FCOS image.
This section consists of two profiles:
control_plane
: The profile of the bootstrap and control plane nodes.
compute
: The profile of workers nodes in the compute plane.
These profiles have the following parameters. The default values of the parameters meet the minimum requirements for running a production cluster. You can increase or customize these values to meet your workload requirements.
cluster
: The value gets the cluster name from ovirt_cluster
in the General Section.
memory
: The amount of memory, in GB, for the virtual machine.
sockets
: The number of sockets for the virtual machine.
cores
: The number of cores for the virtual machine.
template
: The name of the virtual machine template. If plan to install multiple clusters, and these clusters use templates that contain different specifications, prepend the template name with the ID of the cluster.
operating_system
: The type of guest operating system in the virtual machine. With oVirt/oVirt version 4.4, this value must be rhcos_x64
so the value of Ignition script
can be passed to the VM.
type
: Enter server
as the type of the virtual machine.
You must change the value of the |
disks
: The disk specifications. The control_plane
and compute
nodes can have different storage domains.
size
: The minimum disk size.
name
: Enter the name of a disk connected to the target cluster in oVirt.
interface
: Enter the interface type of the disk you specified.
storage_domain
: Enter the storage domain of the disk you specified.
nics
: Enter the name
and network
the virtual machines use. You can also specify the virtual network interface profile. By default, NICs obtain their MAC addresses from the oVirt/oVirt MAC pool.
This final section, vms
, defines the virtual machines you plan to create and deploy in the cluster. By default, it provides the minimum number of control plane and worker nodes for a production environment.
vms
contains three required elements:
name
: The name of the virtual machine. In this case, metadata.infraID
prepends the virtual machine name with the infrastructure ID from the metadata.yml
file.
ocp_type
: The role of the virtual machine in the OCP cluster. Possible values are bootstrap
, master
, worker
.
profile
: The name of the profile from which each virtual machine inherits specifications. Possible values in this example are control_plane
or compute
.
You can override the value a virtual machine inherits from its profile. To do this, you add the name of the profile attribute to the virtual machine in inventory.yml
and assign it an overriding value. To see an example of this, examine the name: "{{ metadata.infraID }}-bootstrap"
virtual machine in the preceding inventory.yml
example: It has a type
attribute whose value, server
, overrides the value of the type
attribute this virtual machine would otherwise inherit from the control_plane
profile.
For virtual machines, metadata.infraID
prepends the name of the virtual machine with the infrastructure ID from the metadata.json
file you create when you build the Ignition files.
The playbooks use the following code to read infraID
from the specific file located in the ocp.assets_dir
.
---
- name: include metadata.json vars
include_vars:
file: "{{ ocp.assets_dir }}/metadata.json"
name: metadata
...
Update the Fedora CoreOS (FCOS) image settings of the inventory.yml
file. Later, when you run this file one of the playbooks, it downloads a compressed Fedora CoreOS (FCOS) image from the image_url
URL to the local_cmp_image_path
directory. The playbook then uncompresses the image to the local_image_path
directory and uses it to create oVirt/oVirt templates.
Locate the FCOS image download page, such as Download Fedora CoreOS.
From that download page, copy the URL of an OpenStack qcow2
image, such as https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/34.20210611.3.0/x86_64/fedora-coreos-34.20210611.3.0-openstack.x86_64.qcow2.xz
.
Edit the inventory.yml
playbook you downloaded earlier. In it, replace the rhcos
stanza and paste the URL as the value for image_url
. For example:
rhcos:
image_url: "https://builds.coreos.fedoraproject.org/prod/streams/stable/builds/34.20210611.3.0/x86_64/fedora-coreos-34.20210611.3.0-openstack.x86_64.qcow2.xz"
You create an installation configuration file by running the installation program, openshift-install
, and responding to its prompts with information you specified or gathered earlier.
When you finish responding to the prompts, the installation program creates an initial version of the install-config.yaml
file in the assets directory you specified earlier, for example, ./wrk/install-config.yaml
The installation program also creates a file, $HOME/.ovirt/ovirt-config.yaml
, that contains all the connection parameters that are required to reach the Engine and use its REST API.
NOTE:
The installation process does not use values you supply for some parameters, such as Internal API virtual IP
and Ingress virtual IP
, because you have already configured them in your infrastructure DNS.
It also uses the values you supply for parameters in inventory.yml
, like the ones for oVirt cluster
, oVirt storage
, and oVirt network
. And uses a script to remove or replace these same values from install-config.yaml
with the previously mentioned virtual IPs
.
Run the installation program:
$ openshift-install create install-config --dir $ASSETS_DIR
Respond to the installation program’s prompts with information about your system.
For Internal API virtual IP
and Ingress virtual IP
, supply the IP addresses you specified when you configured the DNS service.
Together, the values you enter for the oVirt cluster
and Base Domain
prompts form the FQDN portion of URLs for the REST API and any applications you create, such as https://api.ocp4.example.org:6443/
and https://console-openshift-console.apps.ocp4.example.org
.
You can get the pull secret from the Red Hat OpenShift Cluster Manager.
You can customize the install-config.yaml
file to specify more details about your OKD cluster’s platform or modify the values of the required parameters.
apiVersion: v1
baseDomain: example.com (1)
compute: (2)
- hyperthreading: Enabled (3)
name: worker
replicas: 0 (4)
controlPlane: (2)
hyperthreading: Enabled (3)
name: master
replicas: 3 (5)
metadata:
name: test (6)
networking:
clusterNetwork:
- cidr: 10.128.0.0/14 (7)
hostPrefix: 23 (8)
networkType: OVNKubernetes
serviceNetwork: (9)
- 172.30.0.0/16
platform:
none: {} (10)
pullSecret: '{"auths": ...}' (11)
sshKey: 'ssh-ed25519 AAAA...' (12)
1 | The base domain of the cluster. All DNS records must be sub-domains of this base and include the cluster name. | ||||
2 | The controlPlane section is a single mapping, but the compute section is a sequence of mappings. To meet the requirements of the different data structures, the first line of the compute section must begin with a hyphen, - , and the first line of the controlPlane section must not. Only one control plane pool is used. |
||||
3 | Whether to enable or disable simultaneous multithreading (SMT), or hyperthreading . By default, SMT is enabled to increase the performance of your machines' cores. You can disable it by setting the parameter value to Disabled . If you disable SMT, you must disable it in all cluster machines; this includes both control plane and compute machines.
|
||||
4 | You must set the value of the replicas parameter to 0 . This parameter
controls the number of workers that the cluster creates and manages for you,
which are functions that the cluster does not perform when you
use user-provisioned infrastructure. You must manually deploy worker
machines for the cluster to use before you finish installing OKD. |
||||
5 | The number of control plane machines that you add to the cluster. Because the cluster uses these values as the number of etcd endpoints in the cluster, the value must match the number of control plane machines that you deploy. | ||||
6 | The cluster name that you specified in your DNS records. | ||||
7 | A block of IP addresses from which pod IP addresses are allocated. This block must not overlap with existing physical networks. These IP addresses are used for the pod network. If you need to access the pods from an external network, you must configure load balancers and routers to manage the traffic.
|
||||
8 | The subnet prefix length to assign to each individual node. For example, if
hostPrefix is set to 23 , then each node is assigned a /23 subnet out of
the given cidr , which allows for 510 (2^(32 - 23) - 2) pod IPs addresses. If
you are required to provide access to nodes from an external network, configure
load balancers and routers to manage the traffic. |
||||
9 | The IP address pool to use for service IP addresses. You can enter only one IP address pool. This block must not overlap with existing physical networks. If you need to access the services from an external network, configure load balancers and routers to manage the traffic. | ||||
10 | You must set the platform to none . You cannot provide additional platform configuration variables for
RHV infrastructure. |
||||
11 | The pull secret from the Red Hat OpenShift Cluster Manager. 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. | ||||
12 | The public portion of the default SSH key for the core user in
Fedora CoreOS (FCOS).
|
Production environments can deny direct access to the Internet and instead have
an HTTP or HTTPS proxy available. You can configure a new OKD
cluster to use a proxy by configuring the proxy settings in the
install-config.yaml
file.
You have an existing install-config.yaml
file.
You reviewed the sites that your cluster requires access to and determined whether any of them need to bypass the proxy. By default, all cluster egress traffic is proxied, including calls to hosting cloud provider APIs. You added sites to the Proxy
object’s spec.noProxy
field to bypass the proxy if necessary.
The For installations on Amazon Web Services (AWS), Google Cloud Platform (GCP), Microsoft Azure, and Red Hat OpenStack Platform (RHOSP), the |
Edit your install-config.yaml
file and add the proxy settings. For example:
apiVersion: v1
baseDomain: my.domain.com
proxy:
httpProxy: http://<username>:<pswd>@<ip>:<port> (1)
httpsProxy: https://<username>:<pswd>@<ip>:<port> (2)
noProxy: example.com (3)
additionalTrustBundle: | (4)
-----BEGIN certificate-----
<MY_TRUSTED_CA_CERT>
-----END certificate-----
...
1 | A proxy URL to use for creating HTTP connections outside the cluster. The
URL scheme must be http . |
2 | A proxy URL to use for creating HTTPS connections outside the cluster. |
3 | A comma-separated list of destination domain names, IP addresses, or
other network CIDRs to exclude from proxying. Preface a domain with . to match subdomains only. For example, .y.com matches x.y.com , but not y.com . Use * to bypass the proxy for all destinations. |
4 | If provided, the installation program generates a config map that is named user-ca-bundle in
the openshift-config namespace to hold the additional CA
certificates. If you provide additionalTrustBundle and at least one proxy setting, the Proxy object is configured to reference the user-ca-bundle config map in the trustedCA field. The Cluster Network
Operator then creates a trusted-ca-bundle config map that merges the contents specified for the trustedCA parameter
with the FCOS trust bundle. The additionalTrustBundle field is required unless
the proxy’s identity certificate is signed by an authority from the FCOS trust
bundle. |
The installation program does not support the proxy |
Save the file and reference it when installing OKD.
The installation program creates a cluster-wide proxy that is named cluster
that uses the proxy
settings in the provided install-config.yaml
file. If no proxy settings are
provided, a cluster
Proxy
object is still created, but it will have a nil
spec
.
Only the |
Here, you use three Python scripts to override some of the installation program’s default behaviors:
By default, the installation program uses the machine API to create nodes. To override this default behavior, you set the number of compute nodes to zero replicas. Later, you use Ansible playbooks to create the compute nodes.
By default, the installation program sets the IP range of the machine network for nodes. To override this default behavior, you set the IP range to match your infrastructure.
By default, the installation program sets the platform to ovirt
. However, installing a cluster on user-provisioned infrastructure is more similar to installing a cluster on bare metal. Therefore, you delete the ovirt platform section from install-config.yaml
and change the platform to none
. Instead, you use inventory.yml
to specify all of the required settings.
These snippets work with Python 3 and Python 2. |
Set the number of compute nodes to zero replicas:
$ python3 -c 'import os, yaml
path = "%s/install-config.yaml" % os.environ["ASSETS_DIR"]
conf = yaml.safe_load(open(path))
conf["compute"][0]["replicas"] = 0
open(path, "w").write(yaml.dump(conf, default_flow_style=False))'
Set the IP range of the machine network. For example, to set the range to 172.16.0.0/16
, enter:
$ python3 -c 'import os, yaml
path = "%s/install-config.yaml" % os.environ["ASSETS_DIR"]
conf = yaml.safe_load(open(path))
conf["networking"]["machineNetwork"][0]["cidr"] = "172.16.0.0/16"
open(path, "w").write(yaml.dump(conf, default_flow_style=False))'
Remove the ovirt
section and change the platform to none
:
$ python3 -c 'import os, yaml
path = "%s/install-config.yaml" % os.environ["ASSETS_DIR"]
conf = yaml.safe_load(open(path))
platform = conf["platform"]
del platform["ovirt"]
platform["none"] = {}
open(path, "w").write(yaml.dump(conf, default_flow_style=False))'
Red Hat Virtualization does not currently support installation with user-provisioned infrastructure on the oVirt platform. Therefore, you must set the platform to
|
Use the installation program to generate a set of manifest files in the assets directory.
The command to generate the manifest files displays a warning message before it consumes the install-config.yaml
file.
If you plan to reuse the install-config.yaml
file, create a backup copy of it before you back it up before you generate the manifest files.
Optional: Create a backup copy of the install-config.yaml
file:
$ cp install-config.yaml install-config.yaml.backup
Generate a set of manifests in your assets directory:
$ openshift-install create manifests --dir $ASSETS_DIR
This command displays the following messages.
INFO Consuming Install Config from target directory
WARNING Making control-plane schedulable by setting MastersSchedulable to true for Scheduler cluster settings
The command generates the following manifest files:
$ tree
.
└── wrk
├── manifests
│ ├── 04-openshift-machine-config-operator.yaml
│ ├── cluster-config.yaml
│ ├── cluster-dns-02-config.yml
│ ├── cluster-infrastructure-02-config.yml
│ ├── cluster-ingress-02-config.yml
│ ├── cluster-network-01-crd.yml
│ ├── cluster-network-02-config.yml
│ ├── cluster-proxy-01-config.yaml
│ ├── cluster-scheduler-02-config.yml
│ ├── cvo-overrides.yaml
│ ├── etcd-ca-bundle-configmap.yaml
│ ├── etcd-client-secret.yaml
│ ├── etcd-host-service-endpoints.yaml
│ ├── etcd-host-service.yaml
│ ├── etcd-metric-client-secret.yaml
│ ├── etcd-metric-serving-ca-configmap.yaml
│ ├── etcd-metric-signer-secret.yaml
│ ├── etcd-namespace.yaml
│ ├── etcd-service.yaml
│ ├── etcd-serving-ca-configmap.yaml
│ ├── etcd-signer-secret.yaml
│ ├── kube-cloud-config.yaml
│ ├── kube-system-configmap-root-ca.yaml
│ ├── machine-config-server-tls-secret.yaml
│ └── openshift-config-secret-pull-secret.yaml
└── openshift
├── 99_kubeadmin-password-secret.yaml
├── 99_openshift-cluster-api_master-user-data-secret.yaml
├── 99_openshift-cluster-api_worker-user-data-secret.yaml
├── 99_openshift-machineconfig_99-master-ssh.yaml
├── 99_openshift-machineconfig_99-worker-ssh.yaml
└── openshift-install-manifests.yaml
Make control plane nodes non-schedulable.
Because you are manually creating and deploying the control plane machines, you must configure a manifest file to make the control plane nodes non-schedulable.
To make the control plane nodes non-schedulable, enter:
$ python3 -c 'import os, yaml
path = "%s/manifests/cluster-scheduler-02-config.yml" % os.environ["ASSETS_DIR"]
data = yaml.safe_load(open(path))
data["spec"]["mastersSchedulable"] = False
open(path, "w").write(yaml.dump(data, default_flow_style=False))'
To build the Ignition files from the manifest files you just generated and modified, you run the installation program. This action creates a Fedora CoreOS (FCOS) machine, initramfs
, which fetches the Ignition files and performs the configurations needed to create a node.
In addition to the Ignition files, the installation program generates the following:
An auth
directory that contains the admin credentials for connecting to the cluster with the oc
and kubectl
utilities.
A metadata.json
file that contains information such as the OKD cluster name, cluster ID, and infrastructure ID for the current installation.
The Ansible playbooks for this installation process use the value of infraID
as a prefix for the virtual machines they create. This prevents naming conflicts when there are multiple installations in the same oVirt/oVirt cluster.
certificates in Ignition configuration files expire after 24 hours. Complete the cluster installation and keep the cluster running in a non-degraded state for 24 hours so that the first certificate rotation can finish. |
To build the Ignition files, enter:
$ openshift-install create ignition-configs --dir $ASSETS_DIR
$ tree
.
└── wrk
├── auth
│ ├── kubeadmin-password
│ └── kubeconfig
├── bootstrap.ign
├── master.ign
├── metadata.json
└── worker.ign
After confirming the variables in the inventory.yml
, you run the first Ansible provisioning playbook, create-templates-and-vms.yml
.
This playbook uses the connection parameters for the oVirt Engine from $HOME/.ovirt/ovirt-config.yaml
and reads metadata.json
in the assets directory.
If a local Fedora CoreOS (FCOS) image is not already present, the playbook downloads one from the URL you specified for image_url
in inventory.yml
. It extracts the image and uploads it to oVirt to create templates.
The playbook creates a template based on the control_plane
and compute
profiles in the inventory.yml
file. If these profiles have different names, it creates two templates.
When the playbook finishes, the virtual machines it creates are stopped. You can get information from them to help configure other infrastructure elements. For example, you can get the virtual machines' MAC addresses to configure DHCP to assign permanent IP addresses to the virtual machines.
In inventory.yml
, under the control_plane
and compute
variables, change both instances of type: high_performance
to type: server
.
Optional: If you plan to perform multiple installations to the same cluster, create different templates for each OCP installation. In the inventory.yml
file, prepend the value of template
with infraID
. For example:
control_plane:
cluster: "{{ ovirt_cluster }}"
memory: 16GiB
sockets: 4
cores: 1
template: "{{ metadata.infraID }}-rhcos_tpl"
operating_system: "rhcos_x64"
...
Create the templates and virtual machines:
$ ansible-playbook -i inventory.yml create-templates-and-vms.yml
You create a bootstrap machine by running the bootstrap.yml
playbook. This playbook starts the bootstrap virtual machine, and passes it the bootstrap.ign
Ignition file from the assets directory. The bootstrap node configures itself so it can serve Ignition files to the control plane nodes.
To monitor the bootstrap process, you use the console in the oVirt Administration Portal or connect to the virtual machine by using SSH.
Create the bootstrap machine:
$ ansible-playbook -i inventory.yml bootstrap.yml
Connect to the bootstrap machine using a console in the Administration Portal or SSH. Replace <bootstrap_ip>
with the bootstrap node IP address. To use SSH, enter:
$ ssh core@<boostrap.ip>
Collect bootkube.service
journald unit logs for the release image service from the bootstrap node:
[core@ocp4-lk6b4-bootstrap ~]$ journalctl -b -f -u release-image.service -u bootkube.service
The |
You create the control plane nodes by running the masters.yml
playbook. This playbook passes the master.ign
Ignition file to each of the virtual machines. The Ignition file contains a directive for the control plane node to get the Ignition from a URL such as https://api-int.ocp4.example.org:22623/config/master
. The port number in this URL is managed by the load balancer, and is accessible only inside the cluster.
Create the control plane nodes:
$ ansible-playbook -i inventory.yml masters.yml
While the playbook creates your control plane, monitor the bootstrapping process:
$ openshift-install wait-for bootstrap-complete --dir $ASSETS_DIR
INFO API v1.18.3+b74c5ed up
INFO Waiting up to 40m0s for bootstrapping to complete...
When all the pods on the control plane nodes and etcd are up and running, the installation program displays the following output.
INFO It is now safe to remove the bootstrap resources
You can verify your OKD cluster’s status during or after installation.
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
After the wait-for
command shows that the bootstrap process is complete, you must remove the bootstrap virtual machine to free up compute, memory, and storage resources. Also, remove settings for the bootstrap machine from the load balancer directives.
To remove the bootstrap machine from the cluster, enter:
$ ansible-playbook -i inventory.yml retire-bootstrap.yml
Remove settings for the bootstrap machine from the load balancer directives.
Creating worker nodes is similar to creating control plane nodes. However, worker nodes workers do not automatically join the cluster. To add them to the cluster, you review and approve the workers' pending CSRs (certificate Signing Requests).
After approving the first requests, you continue approving CSR until all of the worker nodes are approved. When you complete this process, the worker nodes become Ready
and can have pods scheduled to run on them.
Finally, monitor the command line to see when the installation process completes.
Create the worker nodes:
$ ansible-playbook -i inventory.yml workers.yml
To list all of the CSRs, enter:
$ oc get csr -A
Eventually, this command displays one CSR per node. For example:
NAME AGE SIGNERNAME REQUESTOR CONDITION
csr-2lnxd 63m kubernetes.io/kubelet-serving system:node:ocp4-lk6b4-master0.ocp4.example.org Approved,Issued
csr-hff4q 64m kubernetes.io/kube-apiserver-client-kubelet system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Approved,Issued
csr-hsn96 60m kubernetes.io/kubelet-serving system:node:ocp4-lk6b4-master2.ocp4.example.org Approved,Issued
csr-m724n 6m2s kubernetes.io/kube-apiserver-client-kubelet system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Pending
csr-p4dz2 60m kubernetes.io/kube-apiserver-client-kubelet system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Approved,Issued
csr-t9vfj 60m kubernetes.io/kubelet-serving system:node:ocp4-lk6b4-master1.ocp4.example.org Approved,Issued
csr-tggtr 61m kubernetes.io/kube-apiserver-client-kubelet system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Approved,Issued
csr-wcbrf 7m6s kubernetes.io/kube-apiserver-client-kubelet system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Pending
To filter the list and see only pending CSRs, enter:
$ watch "oc get csr -A | grep pending -i"
This command refreshes the output every two seconds and displays only pending CSRs. For example:
Every 2.0s: oc get csr -A | grep pending -i
csr-m724n 10m kubernetes.io/kube-apiserver-client-kubelet system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Pending
csr-wcbrf 11m kubernetes.io/kube-apiserver-client-kubelet system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Pending
Inspect each pending request. For example:
$ oc describe csr csr-m724n
Name: csr-m724n
Labels: <none>
Annotations: <none>
CreationTimestamp: Sun, 19 Jul 2020 15:59:37 +0200
Requesting User: system:serviceaccount:openshift-machine-config-operator:node-bootstrapper
Signer: kubernetes.io/kube-apiserver-client-kubelet
Status: Pending
Subject:
Common Name: system:node:ocp4-lk6b4-worker1.ocp4.example.org
Serial Number:
Organization: system:nodes
Events: <none>
If the CSR information is correct, approve the request:
$ oc adm certificate approve csr-m724n
Wait for the installation process to finish:
$ openshift-install wait-for install-complete --dir $ASSETS_DIR --log-level debug
When the installation completes, the command line displays the URL of the OKD web console and the administrator user name and password.
See About remote health monitoring for more information about the Telemetry service
Operator catalogs that source content provided by Red Hat and community projects are configured for OperatorHub by default during an OKD installation. In a restricted network environment, you must disable the default catalogs as a cluster administrator.
Disable the sources for the default catalogs by adding disableAllDefaultSources: true
to the OperatorHub
object:
$ oc patch OperatorHub cluster --type json \
-p '[{"op": "add", "path": "/spec/disableAllDefaultSources", "value": true}]'
Alternatively, you can use the web console to manage catalog sources. From the Administration → Cluster Settings → Global Configuration → OperatorHub page, click the Sources tab, where you can create, delete, disable, and enable individual sources. |