Installing a cluster on oVirt in a restricted network

In OKD version 4.13, you can install a customized OKD cluster on oVirt in a restricted network by creating an internal mirror of the installation release content.

Prerequisites

The following items are required to install an OKD cluster on a oVirt environment.

About installations in restricted networks

In OKD 4.13, 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, Nutanix, or on VMware vSphere.

To complete a restricted network installation, you must create a registry that mirrors the contents of the OpenShift image 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.

Additional limits

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.

Requirements for the oVirt environment

To install and run an OKD version 4.13 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 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 SuperUser privileges on oVirt during the installation process. The installation program saves the credentials you provide to a temporary ovirt-config.yaml file that might be compromised.

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

  1. Check that the oVirt version supports installation of OKD version 4.13.

    1. In the oVirt Administration Portal, click the ? help icon in the upper-right corner and select About.

    2. In the window that opens, make a note of the oVirt Software Version.

    3. Confirm that the oVirt version is 4.4. For more information about supported version combinations, see Support Matrix for OKD on oVirt.

  2. Inspect the data center, cluster, and storage.

    1. In the oVirt Administration Portal, click ComputeData Centers.

    2. Confirm that the data center where you plan to install OKD is accessible.

    3. Click the name of that data center.

    4. In the data center details, on the Storage tab, confirm the storage domain where you plan to install OKD is Active.

    5. Record the Domain Name for use later on.

    6. Confirm Free Space has at least 230 GiB.

    7. Confirm that the storage domain meets these etcd backend performance requirements, which you can measure by using the fio performance benchmarking tool.

    8. In the data center details, click the Clusters tab.

    9. Find the oVirt cluster where you plan to install OKD. Record the cluster name for use later on.

  3. Inspect the oVirt host resources.

    1. In the oVirt Administration Portal, click Compute > Clusters.

    2. Click the cluster where you plan to install OKD.

    3. In the cluster details, click the Hosts tab.

    4. Inspect the hosts and confirm they have a combined total of at least 28 Logical CPU Cores available exclusively for the OKD cluster.

    5. Record the number of available Logical CPU Cores for use later on.

    6. Confirm that these CPU cores are distributed so that each of the seven virtual machines created during installation can have four cores.

    7. 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

    8. Record the amount of Max free Memory for scheduling new virtual machines for use later on.

  4. 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:

    1. $ curl -k -u <username>@<profile>:<password> \ (1)
    2. https://<engine-fqdn>/ovirt-engine/api (2)
    1For <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.
    2For <engine-fqdn>, specify the fully qualified domain name of the oVirt environment.

    For example:

    1. $ curl -k -u admin@internal:pw123 \
    2. https://ovirtlab.example.com/ovirt-engine/api

Networking requirements for user-provisioned infrastructure

All the Fedora CoreOS (FCOS) machines require networking to be configured in initramfs during boot to fetch their Ignition config files.

During the initial boot, the machines require an IP address configuration that is set either through a DHCP server or statically by providing the required boot options. After a network connection is established, the machines download their Ignition config files from an HTTP or HTTPS server. The Ignition config files are then used to set the exact state of each machine. The Machine Config Operator completes more changes to the machines, such as the application of new certificates or keys, after installation.

It is recommended to use a DHCP server for long-term management of the cluster machines. Ensure that the DHCP server is configured to provide persistent IP addresses, DNS server information, and hostnames to the cluster machines.

If a DHCP service is not available for your user-provisioned infrastructure, you can instead provide the IP networking configuration and the address of the DNS server to the nodes at FCOS install time. These can be passed as boot arguments if you are installing from an ISO image. See the Installing FCOS and starting the OKD bootstrap process section for more information about static IP provisioning and advanced networking options.

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.

Firewall

Configure your firewall so your cluster has access to required sites.

See also:

DNS

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.

Setting the cluster node hostnames through DHCP

On Fedora CoreOS (FCOS) machines, the hostname is set through NetworkManager. By default, the machines obtain their hostname through DHCP. If the hostname is not provided by DHCP, set statically through kernel arguments, or another method, it is obtained through a reverse DNS lookup. Reverse DNS lookup occurs after the network has been initialized on a node and can take time to resolve. Other system services can start prior to this and detect the hostname as localhost or similar. You can avoid this by using DHCP to provide the hostname for each cluster node.

Additionally, setting the hostnames through DHCP can bypass any manual DNS record name configuration errors in environments that have a DNS split-horizon implementation.

Network connectivity requirements

You must configure the network connectivity between machines to allow OKD cluster components to communicate. Each machine must be able to resolve the hostnames of all other machines in the cluster.

This section provides details about the ports that are required.

In connected OKD environments, all nodes are required to have internet access to pull images for platform containers and provide telemetry data to Red Hat.

Table 1. Ports used for all-machine to all-machine communications
ProtocolPortDescription

ICMP

N/A

Network reachability tests

TCP

1936

Metrics

9000-9999

Host level services, including the node exporter on ports 9100-9101 and the Cluster Version Operator on port 9099.

10250-10259

The default ports that Kubernetes reserves

10256

openshift-sdn

UDP

4789

VXLAN

6081

Geneve

9000-9999

Host level services, including the node exporter on ports 9100-9101.

500

IPsec IKE packets

4500

IPsec NAT-T packets

TCP/UDP

30000-32767

Kubernetes node port

ESP

N/A

IPsec Encapsulating Security Payload (ESP)

Table 2. Ports used for all-machine to control plane communications
ProtocolPortDescription

TCP

6443

Kubernetes API

Table 3. Ports used for control plane machine to control plane machine communications
ProtocolPortDescription

TCP

2379-2380

etcd server and peer ports

NTP configuration for user-provisioned infrastructure

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.

User-provisioned DNS requirements

In OKD deployments, DNS name resolution is required for the following components:

  • The Kubernetes API

  • The OKD application wildcard

  • The bootstrap, control plane, and compute machines

Reverse DNS resolution is also required for the Kubernetes API, the bootstrap machine, the control plane machines, and the compute machines.

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 hostnames for all the nodes, unless the hostnames are provided by DHCP. Additionally, the reverse records are used to generate the certificate signing requests (CSR) that OKD needs to operate.

It is recommended to use a DHCP server to provide the hostnames to each cluster node. See the DHCP recommendations for user-provisioned infrastructure section for more information.

The following DNS records are required for a user-provisioned OKD cluster and they must be in place before installation. In each record, <cluster_name> is the cluster name and <base_domain> is the base domain that you specify in the install-config.yaml file. A complete DNS record takes the form: <component>.<cluster_name>.<base_domain>..

Table 4. Required DNS records
ComponentRecordDescription

Kubernetes API

api.<cluster_name>.<base_domain>.

A DNS A/AAAA or CNAME record, and a DNS PTR record, to identify the API load balancer. These records must be resolvable by both clients external to the cluster and from all the nodes within the cluster.

api-int.<cluster_name>.<base_domain>.

A DNS A/AAAA or CNAME record, and a DNS PTR record, to internally identify the API load balancer. These records must be resolvable from all the nodes within the cluster.

The API server must be able to resolve the worker nodes by the hostnames that are recorded in Kubernetes. If the API server cannot resolve the node names, then proxied API calls can fail, and you cannot retrieve logs from pods.

Routes

*.apps.<cluster_name>.<base_domain>.

A wildcard DNS A/AAAA or CNAME record that refers to the application ingress load balancer. The application ingress load balancer targets the machines that run the Ingress Controller pods. The Ingress Controller pods run on the compute machines by default. These records must be resolvable by both clients external to the cluster and from all the nodes within the cluster.

For example, console-openshift-console.apps.<cluster_name>.<base_domain> is used as a wildcard route to the OKD console.

Bootstrap machine

bootstrap.<cluster_name>.<base_domain>.

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.

Control plane machines

<master><n>.<cluster_name>.<base_domain>.

DNS A/AAAA or CNAME records and DNS PTR records to identify each machine for the control plane nodes. These records must be resolvable by the nodes within the cluster.

Compute machines

<worker><n>.<cluster_name>.<base_domain>.

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.

In OKD 4.4 and later, you do not need to specify etcd host and SRV records in your DNS configuration.

You can use the dig command to verify name and reverse name resolution. See the section on Validating DNS resolution for user-provisioned infrastructure for detailed validation steps.

Example DNS configuration for user-provisioned clusters

This section provides A and PTR record configuration samples that meet the DNS requirements for deploying OKD on user-provisioned infrastructure. The samples are not meant to provide advice for choosing one DNS solution over another.

In the examples, the cluster name is ocp4 and the base domain is example.com.

Example DNS A record configuration for a user-provisioned cluster

The following example is a BIND zone file that shows sample A records for name resolution in a user-provisioned cluster.

Sample DNS zone database

  1. $TTL 1W
  2. @ IN SOA ns1.example.com. root (
  3. 2019070700 ; serial
  4. 3H ; refresh (3 hours)
  5. 30M ; retry (30 minutes)
  6. 2W ; expiry (2 weeks)
  7. 1W ) ; minimum (1 week)
  8. IN NS ns1.example.com.
  9. IN MX 10 smtp.example.com.
  10. ;
  11. ;
  12. ns1.example.com. IN A 192.168.1.5
  13. smtp.example.com. IN A 192.168.1.5
  14. ;
  15. helper.example.com. IN A 192.168.1.5
  16. helper.ocp4.example.com. IN A 192.168.1.5
  17. ;
  18. api.ocp4.example.com. IN A 192.168.1.5 (1)
  19. api-int.ocp4.example.com. IN A 192.168.1.5 (2)
  20. ;
  21. *.apps.ocp4.example.com. IN A 192.168.1.5 (3)
  22. ;
  23. bootstrap.ocp4.example.com. IN A 192.168.1.96 (4)
  24. ;
  25. master0.ocp4.example.com. IN A 192.168.1.97 (5)
  26. master1.ocp4.example.com. IN A 192.168.1.98 (5)
  27. master2.ocp4.example.com. IN A 192.168.1.99 (5)
  28. ;
  29. worker0.ocp4.example.com. IN A 192.168.1.11 (6)
  30. worker1.ocp4.example.com. IN A 192.168.1.7 (6)
  31. ;
  32. ;EOF
1Provides name resolution for the Kubernetes API. The record refers to the IP address of the API load balancer.
2Provides name resolution for the Kubernetes API. The record refers to the IP address of the API load balancer and is used for internal cluster communications.
3Provides name resolution for the wildcard routes. The record refers to the IP address of the application ingress load balancer. The application ingress load balancer targets the machines that run the Ingress Controller pods. The Ingress Controller pods run on the compute machines by default.

In the example, the same load balancer is used for the Kubernetes API and application ingress traffic. In production scenarios, you can deploy the API and application ingress load balancers separately so that you can scale the load balancer infrastructure for each in isolation.

4Provides name resolution for the bootstrap machine.
5Provides name resolution for the control plane machines.
6Provides name resolution for the compute machines.

Example DNS PTR record configuration for a user-provisioned cluster

The following example BIND zone file shows sample PTR records for reverse name resolution in a user-provisioned cluster.

Sample DNS zone database for reverse records

  1. $TTL 1W
  2. @ IN SOA ns1.example.com. root (
  3. 2019070700 ; serial
  4. 3H ; refresh (3 hours)
  5. 30M ; retry (30 minutes)
  6. 2W ; expiry (2 weeks)
  7. 1W ) ; minimum (1 week)
  8. IN NS ns1.example.com.
  9. ;
  10. 5.1.168.192.in-addr.arpa. IN PTR api.ocp4.example.com. (1)
  11. 5.1.168.192.in-addr.arpa. IN PTR api-int.ocp4.example.com. (2)
  12. ;
  13. 96.1.168.192.in-addr.arpa. IN PTR bootstrap.ocp4.example.com. (3)
  14. ;
  15. 97.1.168.192.in-addr.arpa. IN PTR master0.ocp4.example.com. (4)
  16. 98.1.168.192.in-addr.arpa. IN PTR master1.ocp4.example.com. (4)
  17. 99.1.168.192.in-addr.arpa. IN PTR master2.ocp4.example.com. (4)
  18. ;
  19. 11.1.168.192.in-addr.arpa. IN PTR worker0.ocp4.example.com. (5)
  20. 7.1.168.192.in-addr.arpa. IN PTR worker1.ocp4.example.com. (5)
  21. ;
  22. ;EOF
1Provides reverse DNS resolution for the Kubernetes API. The PTR record refers to the record name of the API load balancer.
2Provides reverse DNS resolution for the Kubernetes API. The PTR record refers to the record name of the API load balancer and is used for internal cluster communications.
3Provides reverse DNS resolution for the bootstrap machine.
4Provides reverse DNS resolution for the control plane machines.
5Provides reverse DNS resolution for the compute machines.

A PTR record is not required for the OKD application wildcard.

Load balancing requirements for user-provisioned infrastructure

Before you install OKD, you must provision the API and application ingress load balancing infrastructure. In production scenarios, you can deploy the API and application ingress load balancers separately so that you can scale the load balancer infrastructure for each in isolation.

If you want to deploy the API and application ingress load balancers with a Fedora instance, you must purchase the Fedora subscription separately.

The load balancing infrastructure must meet the following requirements:

  1. 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.

    Session persistence is not required for the API load balancer to function properly.

    Configure the following ports on both the front and back of the load balancers:

    Table 5. API load balancer
    PortBack-end machines (pool members)InternalExternalDescription

    6443

    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 /readyz endpoint for the API server health check probe.

    X

    X

    Kubernetes API server

    22623

    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 /readyz endpoint to the removal of the API server instance from the pool. Within the time frame after /readyz returns an error or becomes healthy, the endpoint must have been removed or added. Probing every 5 or 10 seconds, with two successful requests to become healthy and three to become unhealthy, are well-tested values.

  2. 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.

    If the true IP address of the client can be seen by the application ingress load balancer, enabling source IP-based session persistence can improve performance for applications that use end-to-end TLS encryption.

    Configure the following ports on both the front and back of the load balancers:

    Table 6. Application ingress load balancer
    PortBack-end machines (pool members)InternalExternalDescription

    443

    The machines that run the Ingress Controller pods, compute, or worker, by default.

    X

    X

    HTTPS traffic

    80

    The machines that run the Ingress Controller pods, compute, or worker, by default.

    X

    X

    HTTP traffic

    1936

    The worker nodes that run the Ingress Controller pods, by default. You must configure the /healthz/ready endpoint for the ingress health check probe.

    X

    X

    HTTP traffic

If you are deploying a three-node cluster with zero compute nodes, the Ingress Controller pods run on the control plane nodes. In three-node cluster deployments, you must configure your application ingress load balancer to route HTTP and HTTPS traffic to the control plane nodes.

A working configuration for the Ingress router is required for an OKD cluster. You must configure the Ingress router after the control plane initializes.

Example load balancer configuration for user-provisioned clusters

This section provides an example API and application ingress load balancer configuration that meets the load balancing requirements for user-provisioned clusters. The sample is an /etc/haproxy/haproxy.cfg configuration for an HAProxy load balancer. The example is not meant to provide advice for choosing one load balancing solution over another.

In the example, the same load balancer is used for the Kubernetes API and application ingress traffic. In production scenarios you can deploy the API and application ingress load balancers separately so that you can scale the load balancer infrastructure for each in isolation.

Sample API and application ingress load balancer configuration

  1. global
  2. log 127.0.0.1 local2
  3. pidfile /var/run/haproxy.pid
  4. maxconn 4000
  5. daemon
  6. defaults
  7. mode http
  8. log global
  9. option dontlognull
  10. option http-server-close
  11. option redispatch
  12. retries 3
  13. timeout http-request 10s
  14. timeout queue 1m
  15. timeout connect 10s
  16. timeout client 1m
  17. timeout server 1m
  18. timeout http-keep-alive 10s
  19. timeout check 10s
  20. maxconn 3000
  21. frontend stats
  22. bind *:1936
  23. mode http
  24. log global
  25. maxconn 10
  26. stats enable
  27. stats hide-version
  28. stats refresh 30s
  29. stats show-node
  30. stats show-desc Stats for ocp4 cluster (1)
  31. stats auth admin:ocp4
  32. stats uri /stats
  33. listen api-server-6443 (2)
  34. bind *:6443
  35. mode tcp
  36. server bootstrap bootstrap.ocp4.example.com:6443 check inter 1s backup (3)
  37. server master0 master0.ocp4.example.com:6443 check inter 1s
  38. server master1 master1.ocp4.example.com:6443 check inter 1s
  39. server master2 master2.ocp4.example.com:6443 check inter 1s
  40. listen machine-config-server-22623 (4)
  41. bind *:22623
  42. mode tcp
  43. server bootstrap bootstrap.ocp4.example.com:22623 check inter 1s backup (3)
  44. server master0 master0.ocp4.example.com:22623 check inter 1s
  45. server master1 master1.ocp4.example.com:22623 check inter 1s
  46. server master2 master2.ocp4.example.com:22623 check inter 1s
  47. listen ingress-router-443 (5)
  48. bind *:443
  49. mode tcp
  50. balance source
  51. server worker0 worker0.ocp4.example.com:443 check inter 1s
  52. server worker1 worker1.ocp4.example.com:443 check inter 1s
  53. listen ingress-router-80 (6)
  54. bind *:80
  55. mode tcp
  56. balance source
  57. server worker0 worker0.ocp4.example.com:80 check inter 1s
  58. server worker1 worker1.ocp4.example.com:80 check inter 1s
1In the example, the cluster name is ocp4.
2Port 6443 handles the Kubernetes API traffic and points to the control plane machines.
3The bootstrap entries must be in place before the OKD cluster installation and they must be removed after the bootstrap process is complete.
4Port 22623 handles the machine config server traffic and points to the control plane machines.
5Port 443 handles the HTTPS traffic and points to the machines that run the Ingress Controller pods. The Ingress Controller pods run on the compute machines by default.
6Port 80 handles the HTTP traffic and points to the machines that run the Ingress Controller pods. The Ingress Controller pods run on the compute machines by default.

If you are deploying a three-node cluster with zero compute nodes, the Ingress Controller pods run on the control plane nodes. In three-node cluster deployments, you must configure your application ingress load balancer to route HTTP and HTTPS traffic to the control plane nodes.

If you are using HAProxy as a load balancer, you can check that the haproxy process is listening on ports 6443, 22623, 443, and 80 by running netstat -nltupe on the HAProxy node.

If you are using HAProxy as a load balancer and SELinux is set to enforcing, you must ensure that the HAProxy service can bind to the configured TCP port by running setsebool -P haproxy_connect_any=1.

Setting up the installation machine

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.

Procedure

  1. Update or install Python3 and Ansible. For example:

    1. # dnf update python3 ansible
  2. Install the python3-ovirt-engine-sdk4 package to get the Python Software Development Kit.

  3. 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:

    1. # dnf install ovirt-ansible-image-template
  4. 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.

    1. # dnf install ovirt-ansible-vm-infra
  5. Create an environment variable and assign an absolute or relative path to it. For example, enter:

    1. $ 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.

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

  1. 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:

      1. $ curl -k 'https://<engine-fqdn>/ovirt-engine/services/pki-resource?resource=ca-certificate&format=X509-PEM-CA' -o /tmp/ca.pem (1)
      1For <engine-fqdn>, specify the fully qualified domain name of the oVirt Engine, such as rhv-env.virtlab.example.com.
  2. 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--):

    1. $ sudo chmod 0644 /tmp/ca.pem
  3. For Linux, copy the CA certificate to the directory for server certificates. Use -p to preserve the permissions:

    1. $ sudo cp -p /tmp/ca.pem /etc/pki/ca-trust/source/anchors/ca.pem
  4. 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:

      1. $ sudo update-ca-trust

      If you use your own certificate authority, make sure the system trusts it.

Additional resources

Generating a key pair for cluster node SSH access

During an OKD installation, you can provide an SSH public key to the installation program. The key is passed to the Fedora CoreOS (FCOS) nodes through their Ignition config files and is used to authenticate SSH access to the nodes. The key is added to the ~/.ssh/authorized_keys list for the core user on each node, which enables password-less authentication.

After the key is passed to the nodes, you can use the key pair to SSH in to the FCOS nodes as the user core. To access the nodes through SSH, the private key identity must be managed by SSH for your local user.

If you want to SSH in to your cluster nodes to perform installation debugging or disaster recovery, you must provide the SSH public key during the installation process. The ./openshift-install gather command also requires the SSH public key to be in place on the cluster nodes.

Do not skip this procedure in production environments, where disaster recovery and debugging is required.

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 /home/core/.ssh/authorized_keys.d/core file. However, the Machine Config Operator manages SSH keys in the /home/core/.ssh/authorized_keys file and configures sshd to ignore the /home/core/.ssh/authorized_keys.d/core file. As a result, newly provisioned OKD nodes are not accessible using SSH until the Machine Config Operator reconciles the machine configs with the authorized_keys file. After you can access the nodes using SSH, you can delete the /home/core/.ssh/authorized_keys.d/core file.

Procedure

  1. If you do not have an existing SSH key pair on your local machine to use for authentication onto your cluster nodes, create one. For example, on a computer that uses a Linux operating system, run the following command:

    1. $ ssh-keygen -t ed25519 -N '' -f <path>/<file_name> (1)
    1Specify the path and file name, such as ~/.ssh/id_ed25519, of the new SSH key. If you have an existing key pair, ensure your public key is in the your ~/.ssh directory.

    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 the ed25519 algorithm. Instead, create a key that uses the rsa or ecdsa algorithm.

  2. View the public SSH key:

    1. $ cat <path>/<file_name>.pub

    For example, run the following to view the ~/.ssh/id_ed25519.pub public key:

    1. $ cat ~/.ssh/id_ed25519.pub
  3. Add the SSH private key identity to the SSH agent for your local user, if it has not already been added. SSH agent management of the key is required for password-less SSH authentication onto your cluster nodes, or if you want to use the ./openshift-install gather command.

    On some distributions, default SSH private key identities such as ~/.ssh/id_rsa and ~/.ssh/id_dsa are managed automatically.

    1. If the ssh-agent process is not already running for your local user, start it as a background task:

      1. $ eval "$(ssh-agent -s)"

      Example output

      1. 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.

  4. Add your SSH private key to the ssh-agent:

    1. $ ssh-add <path>/<file_name> (1)
    1Specify the path and file name for your SSH private key, such as ~/.ssh/id_ed25519

    Example output

    1. Identity added: /home/<you>/<path>/<file_name> (<computer_name>)

Next steps

  • When you install OKD, provide the SSH public key to the installation program.

Downloading the Ansible playbooks

Download the Ansible playbooks for installing OKD version 4.13 on oVirt.

Procedure

  • On your installation machine, run the following commands:

    1. $ mkdir playbooks
    1. $ cd playbooks
    1. $ xargs -n 1 curl -O <<< '
    2. https://raw.githubusercontent.com/openshift/installer/release-4.13/upi/ovirt/bootstrap.yml
    3. https://raw.githubusercontent.com/openshift/installer/release-4.13/upi/ovirt/common-auth.yml
    4. https://raw.githubusercontent.com/openshift/installer/release-4.13/upi/ovirt/create-templates-and-vms.yml
    5. https://raw.githubusercontent.com/openshift/installer/release-4.13/upi/ovirt/inventory.yml
    6. https://raw.githubusercontent.com/openshift/installer/release-4.13/upi/ovirt/masters.yml
    7. https://raw.githubusercontent.com/openshift/installer/release-4.13/upi/ovirt/retire-bootstrap.yml
    8. https://raw.githubusercontent.com/openshift/installer/release-4.13/upi/ovirt/retire-masters.yml
    9. https://raw.githubusercontent.com/openshift/installer/release-4.13/upi/ovirt/retire-workers.yml
    10. https://raw.githubusercontent.com/openshift/installer/release-4.13/upi/ovirt/workers.yml'

Next steps

  • 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.

The inventory.yml file

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.

Example inventory.yml file

  1. ---
  2. all:
  3. vars:
  4. ovirt_cluster: "Default"
  5. ocp:
  6. assets_dir: "{{ lookup('env', 'ASSETS_DIR') }}"
  7. ovirt_config_path: "{{ lookup('env', 'HOME') }}/.ovirt/ovirt-config.yaml"
  8. # ---
  9. # {op-system} section
  10. # ---
  11. rhcos:
  12. image_url: "https://mirror.openshift.com/pub/openshift-v4/dependencies/rhcos/4.13/latest/rhcos-openstack.x86_64.qcow2.gz"
  13. local_cmp_image_path: "/tmp/rhcos.qcow2.gz"
  14. local_image_path: "/tmp/rhcos.qcow2"
  15. # ---
  16. # Profiles section
  17. # ---
  18. control_plane:
  19. cluster: "{{ ovirt_cluster }}"
  20. memory: 16GiB
  21. sockets: 4
  22. cores: 1
  23. template: rhcos_tpl
  24. operating_system: "rhcos_x64"
  25. type: high_performance
  26. graphical_console:
  27. headless_mode: false
  28. protocol:
  29. - spice
  30. - vnc
  31. disks:
  32. - size: 120GiB
  33. name: os
  34. interface: virtio_scsi
  35. storage_domain: depot_nvme
  36. nics:
  37. - name: nic1
  38. network: lab
  39. profile: lab
  40. compute:
  41. cluster: "{{ ovirt_cluster }}"
  42. memory: 16GiB
  43. sockets: 4
  44. cores: 1
  45. template: worker_rhcos_tpl
  46. operating_system: "rhcos_x64"
  47. type: high_performance
  48. graphical_console:
  49. headless_mode: false
  50. protocol:
  51. - spice
  52. - vnc
  53. disks:
  54. - size: 120GiB
  55. name: os
  56. interface: virtio_scsi
  57. storage_domain: depot_nvme
  58. nics:
  59. - name: nic1
  60. network: lab
  61. profile: lab
  62. # ---
  63. # Virtual machines section
  64. # ---
  65. vms:
  66. - name: "{{ metadata.infraID }}-bootstrap"
  67. ocp_type: bootstrap
  68. profile: "{{ control_plane }}"
  69. type: server
  70. - name: "{{ metadata.infraID }}-master0"
  71. ocp_type: master
  72. profile: "{{ control_plane }}"
  73. - name: "{{ metadata.infraID }}-master1"
  74. ocp_type: master
  75. profile: "{{ control_plane }}"
  76. - name: "{{ metadata.infraID }}-master2"
  77. ocp_type: master
  78. profile: "{{ control_plane }}"
  79. - name: "{{ metadata.infraID }}-worker0"
  80. ocp_type: worker
  81. profile: "{{ compute }}"
  82. - name: "{{ metadata.infraID }}-worker1"
  83. ocp_type: worker
  84. profile: "{{ compute }}"
  85. - name: "{{ metadata.infraID }}-worker2"
  86. ocp_type: worker
  87. 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.

General section

  • 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.

Fedora CoreOS (FCOS) section

  • 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.

Profiles section

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 type parameter from high_performance to server.

  • 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.

Virtual machines section

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 OKD 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.

Metadata variables

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.

  1. ---
  2. - name: include metadata.json vars
  3. include_vars:
  4. file: "{{ ocp.assets_dir }}/metadata.json"
  5. name: metadata
  6. ...

Specifying the FCOS image settings

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.

Procedure

  1. Locate the FCOS image download page, such as Download Fedora CoreOS.

  2. 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.

  3. 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:

    1. rhcos:
    2. 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"

Creating the install config file

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.

Procedure

  1. Run the installation program:

    1. $ openshift-install create install-config --dir $ASSETS_DIR
  2. 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.

Sample install-config.yaml file for RHV

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.

  1. apiVersion: v1
  2. baseDomain: example.com (1)
  3. compute: (2)
  4. - hyperthreading: Enabled (3)
  5. name: worker
  6. replicas: 0 (4)
  7. controlPlane: (2)
  8. hyperthreading: Enabled (3)
  9. name: master
  10. replicas: 3 (5)
  11. metadata:
  12. name: test (6)
  13. networking:
  14. clusterNetwork:
  15. - cidr: 10.128.0.0/14 (7)
  16. hostPrefix: 23 (8)
  17. networkType: OVNKubernetes (9)
  18. serviceNetwork: (10)
  19. - 172.30.0.0/16
  20. platform:
  21. none: {} (11)
  22. pullSecret: '{"auths": ...}' (12)
  23. sshKey: 'ssh-ed25519 AAAA...' (13)
1The base domain of the cluster. All DNS records must be sub-domains of this base and include the cluster name.
2The 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.
3Specifies whether to enable or disable simultaneous multithreading (SMT), or hyperthreading. By default, SMT is enabled to increase the performance of the cores in your machines. 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.

Simultaneous multithreading (SMT) is enabled by default. If SMT is not enabled in your BIOS settings, the hyperthreading parameter has no effect.

If you disable hyperthreading, whether in the BIOS or in the install-config.yaml file, ensure that your capacity planning accounts for the dramatically decreased machine performance.

4You must set this value to 0 when you install OKD on user-provisioned infrastructure. In installer-provisioned installations, the parameter controls the number of compute machines that the cluster creates and manages for you. In user-provisioned installations, you must manually deploy the compute machines before you finish installing the cluster.

If you are installing a three-node cluster, do not deploy any compute machines when you install the Fedora CoreOS (FCOS) machines.

5The 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.
6The cluster name that you specified in your DNS records.
7A 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.

Class E CIDR range is reserved for a future use. To use the Class E CIDR range, you must ensure your networking environment accepts the IP addresses within the Class E CIDR range.

8The 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 IP addresses. If you are required to provide access to nodes from an external network, configure load balancers and routers to manage the traffic.
9The cluster network plugin to install. The supported values are OVNKubernetes and OpenShiftSDN. The default value is OVNKubernetes.
10The 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.
11You must set the platform to none. You cannot provide additional platform configuration variables for RHV infrastructure.

Clusters that are installed with the platform type none are unable to use some features, such as managing compute machines with the Machine API. This limitation applies even if the compute machines that are attached to the cluster are installed on a platform that would normally support the feature. This parameter cannot be changed after installation.

12The 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.
13The SSH public key for the core user in Fedora CoreOS (FCOS).

For production OKD clusters on which you want to perform installation debugging or disaster recovery, specify an SSH key that your ssh-agent process uses.

Configuring the cluster-wide proxy during installation

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.

Prerequisites

  • 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 Proxy object status.noProxy field is populated with the values of the networking.machineNetwork[].cidr, networking.clusterNetwork[].cidr, and networking.serviceNetwork[] fields from your installation configuration.

    For installations on Amazon Web Services (AWS), Google Cloud Platform (GCP), Microsoft Azure, and OpenStack, the Proxy object status.noProxy field is also populated with the instance metadata endpoint (169.254.169.254).

Procedure

  1. Edit your install-config.yaml file and add the proxy settings. For example:

    1. apiVersion: v1
    2. baseDomain: my.domain.com
    3. proxy:
    4. httpProxy: http://<username>:<pswd>@<ip>:<port> (1)
    5. httpsProxy: https://<username>:<pswd>@<ip>:<port> (2)
    6. noProxy: example.com (3)
    7. additionalTrustBundle: | (4)
    8. -----BEGIN CERTIFICATE-----
    9. <MY_TRUSTED_CA_CERT>
    10. -----END CERTIFICATE-----
    11. additionalTrustBundlePolicy: <policy_to_add_additionalTrustBundle> (5)
    1A proxy URL to use for creating HTTP connections outside the cluster. The URL scheme must be http.
    2A proxy URL to use for creating HTTPS connections outside the cluster.
    3A 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.
    4If provided, the installation program generates a config map that is named user-ca-bundle in the openshift-config namespace that contains one or more additional CA certificates that are required for proxying HTTPS connections. The Cluster Network Operator then creates a trusted-ca-bundle config map that merges these contents with the Fedora CoreOS (FCOS) trust bundle, and this config map is referenced in the trustedCA field of the Proxy object. The additionalTrustBundle field is required unless the proxy’s identity certificate is signed by an authority from the FCOS trust bundle.
    5Optional: The policy to determine the configuration of the Proxy object to reference the user-ca-bundle config map in the trustedCA field. The allowed values are Proxyonly and Always. Use Proxyonly to reference the user-ca-bundle config map only when http/https proxy is configured. Use Always to always reference the user-ca-bundle config map. The default value is Proxyonly.

    The installation program does not support the proxy readinessEndpoints field.

    If the installer times out, restart and then complete the deployment by using the wait-for command of the installer. For example:

    1. $ ./openshift-install wait-for install-complete log-level debug
  2. 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 Proxy object named cluster is supported, and no additional proxies can be created.

Customizing install-config.yaml

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.

Procedure

  1. Set the number of compute nodes to zero replicas:

    1. $ python3 -c 'import os, yaml
    2. path = "%s/install-config.yaml" % os.environ["ASSETS_DIR"]
    3. conf = yaml.safe_load(open(path))
    4. conf["compute"][0]["replicas"] = 0
    5. open(path, "w").write(yaml.dump(conf, default_flow_style=False))'
  2. Set the IP range of the machine network. For example, to set the range to 172.16.0.0/16, enter:

    1. $ python3 -c 'import os, yaml
    2. path = "%s/install-config.yaml" % os.environ["ASSETS_DIR"]
    3. conf = yaml.safe_load(open(path))
    4. conf["networking"]["machineNetwork"][0]["cidr"] = "172.16.0.0/16"
    5. open(path, "w").write(yaml.dump(conf, default_flow_style=False))'
  3. Remove the ovirt section and change the platform to none:

    1. $ python3 -c 'import os, yaml
    2. path = "%s/install-config.yaml" % os.environ["ASSETS_DIR"]
    3. conf = yaml.safe_load(open(path))
    4. platform = conf["platform"]
    5. del platform["ovirt"]
    6. platform["none"] = {}
    7. 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 none, allowing OKD to identify each node as a bare-metal node and the cluster as a bare-metal cluster. This is the same as installing a cluster on any platform, and has the following limitations:

    1. There will be no cluster provider so you must manually add each machine and there will be no node scaling capabilities.

    2. The oVirt CSI driver will not be installed and there will be no CSI capabilities.

Generate manifest files

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.

Procedure

  1. Optional: Create a backup copy of the install-config.yaml file:

    1. $ cp install-config.yaml install-config.yaml.backup
  2. Generate a set of manifests in your assets directory:

    1. $ openshift-install create manifests --dir $ASSETS_DIR

    This command displays the following messages.

    Example output

    1. INFO Consuming Install Config from target directory
    2. WARNING Making control-plane schedulable by setting MastersSchedulable to true for Scheduler cluster settings

    The command generates the following manifest files:

    Example output

    1. $ tree
    2. .
    3. └── wrk
    4. ├── manifests
    5. ├── 04-openshift-machine-config-operator.yaml
    6. ├── cluster-config.yaml
    7. ├── cluster-dns-02-config.yml
    8. ├── cluster-infrastructure-02-config.yml
    9. ├── cluster-ingress-02-config.yml
    10. ├── cluster-network-01-crd.yml
    11. ├── cluster-network-02-config.yml
    12. ├── cluster-proxy-01-config.yaml
    13. ├── cluster-scheduler-02-config.yml
    14. ├── cvo-overrides.yaml
    15. ├── etcd-ca-bundle-configmap.yaml
    16. ├── etcd-client-secret.yaml
    17. ├── etcd-host-service-endpoints.yaml
    18. ├── etcd-host-service.yaml
    19. ├── etcd-metric-client-secret.yaml
    20. ├── etcd-metric-serving-ca-configmap.yaml
    21. ├── etcd-metric-signer-secret.yaml
    22. ├── etcd-namespace.yaml
    23. ├── etcd-service.yaml
    24. ├── etcd-serving-ca-configmap.yaml
    25. ├── etcd-signer-secret.yaml
    26. ├── kube-cloud-config.yaml
    27. ├── kube-system-configmap-root-ca.yaml
    28. ├── machine-config-server-tls-secret.yaml
    29. └── openshift-config-secret-pull-secret.yaml
    30. └── openshift
    31. ├── 99_kubeadmin-password-secret.yaml
    32. ├── 99_openshift-cluster-api_master-user-data-secret.yaml
    33. ├── 99_openshift-cluster-api_worker-user-data-secret.yaml
    34. ├── 99_openshift-machineconfig_99-master-ssh.yaml
    35. ├── 99_openshift-machineconfig_99-worker-ssh.yaml
    36. └── openshift-install-manifests.yaml

Next steps

  • Make control plane nodes non-schedulable.

Making 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.

Procedure

  1. To make the control plane nodes non-schedulable, enter:

    1. $ python3 -c 'import os, yaml
    2. path = "%s/manifests/cluster-scheduler-02-config.yml" % os.environ["ASSETS_DIR"]
    3. data = yaml.safe_load(open(path))
    4. data["spec"]["mastersSchedulable"] = False
    5. open(path, "w").write(yaml.dump(data, default_flow_style=False))'

Building the Ignition files

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.

Procedure

  1. To build the Ignition files, enter:

    1. $ openshift-install create ignition-configs --dir $ASSETS_DIR

    Example output

    1. $ tree
    2. .
    3. └── wrk
    4. ├── auth
    5. ├── kubeadmin-password
    6. └── kubeconfig
    7. ├── bootstrap.ign
    8. ├── master.ign
    9. ├── metadata.json
    10. └── worker.ign

Creating templates and virtual machines

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.

Procedure

  1. In inventory.yml, under the control_plane and compute variables, change both instances of type: high_performance to type: server.

  2. Optional: If you plan to perform multiple installations to the same cluster, create different templates for each OKD installation. In the inventory.yml file, prepend the value of template with infraID. For example:

    1. control_plane:
    2. cluster: "{{ ovirt_cluster }}"
    3. memory: 16GiB
    4. sockets: 4
    5. cores: 1
    6. template: "{{ metadata.infraID }}-rhcos_tpl"
    7. operating_system: "rhcos_x64"
    8. ...
  3. Create the templates and virtual machines:

    1. $ ansible-playbook -i inventory.yml create-templates-and-vms.yml

Creating the bootstrap machine

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.

Procedure

  1. Create the bootstrap machine:

    1. $ ansible-playbook -i inventory.yml bootstrap.yml
  2. 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:

    1. $ ssh core@<boostrap.ip>
  3. Collect bootkube.service journald unit logs for the release image service from the bootstrap node:

    1. [core@ocp4-lk6b4-bootstrap ~]$ journalctl -b -f -u release-image.service -u bootkube.service

    The bootkube.service log on the bootstrap node outputs etcd connection refused errors, indicating that the bootstrap server is unable to connect to etcd on control plane nodes. After etcd has started on each control plane node and the nodes have joined the cluster, the errors should stop.

Creating the control plane nodes

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](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.

Procedure

  1. Create the control plane nodes:

    1. $ ansible-playbook -i inventory.yml masters.yml
  2. While the playbook creates your control plane, monitor the bootstrapping process:

    1. $ openshift-install wait-for bootstrap-complete --dir $ASSETS_DIR

    Example output

    1. INFO API v1.26.0 up
    2. INFO Waiting up to 40m0s for bootstrapping to complete...
  3. When all the pods on the control plane nodes and etcd are up and running, the installation program displays the following output.

    Example output

    1. INFO It is now safe to remove the bootstrap resources

Verifying cluster status

You can verify your OKD cluster’s status during or after installation.

Procedure

  1. In the cluster environment, export the administrator’s kubeconfig file:

    1. $ export KUBECONFIG=<installation_directory>/auth/kubeconfig (1)
    1For <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.

  2. View the control plane and compute machines created after a deployment:

    1. $ oc get nodes
  3. View your cluster’s version:

    1. $ oc get clusterversion
  4. View your Operators’ status:

    1. $ oc get clusteroperator
  5. View all running pods in the cluster:

    1. $ oc get pods -A

Removing the bootstrap machine

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.

Procedure

  1. To remove the bootstrap machine from the cluster, enter:

    1. $ ansible-playbook -i inventory.yml retire-bootstrap.yml
  2. Remove settings for the bootstrap machine from the load balancer directives.

Creating the worker nodes and completing the installation

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.

Procedure

  1. Create the worker nodes:

    1. $ ansible-playbook -i inventory.yml workers.yml
  2. To list all of the CSRs, enter:

    1. $ oc get csr -A

    Eventually, this command displays one CSR per node. For example:

    Example output

    1. NAME AGE SIGNERNAME REQUESTOR CONDITION
    2. csr-2lnxd 63m kubernetes.io/kubelet-serving system:node:ocp4-lk6b4-master0.ocp4.example.org Approved,Issued
    3. csr-hff4q 64m kubernetes.io/kube-apiserver-client-kubelet system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Approved,Issued
    4. csr-hsn96 60m kubernetes.io/kubelet-serving system:node:ocp4-lk6b4-master2.ocp4.example.org Approved,Issued
    5. csr-m724n 6m2s kubernetes.io/kube-apiserver-client-kubelet system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Pending
    6. csr-p4dz2 60m kubernetes.io/kube-apiserver-client-kubelet system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Approved,Issued
    7. csr-t9vfj 60m kubernetes.io/kubelet-serving system:node:ocp4-lk6b4-master1.ocp4.example.org Approved,Issued
    8. csr-tggtr 61m kubernetes.io/kube-apiserver-client-kubelet system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Approved,Issued
    9. csr-wcbrf 7m6s kubernetes.io/kube-apiserver-client-kubelet system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Pending
  3. To filter the list and see only pending CSRs, enter:

    1. $ watch "oc get csr -A | grep pending -i"

    This command refreshes the output every two seconds and displays only pending CSRs. For example:

    Example output

    1. Every 2.0s: oc get csr -A | grep pending -i
    2. csr-m724n 10m kubernetes.io/kube-apiserver-client-kubelet system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Pending
    3. csr-wcbrf 11m kubernetes.io/kube-apiserver-client-kubelet system:serviceaccount:openshift-machine-config-operator:node-bootstrapper Pending
  4. Inspect each pending request. For example:

    Example output

    1. $ oc describe csr csr-m724n

    Example output

    1. Name: csr-m724n
    2. Labels: <none>
    3. Annotations: <none>
    4. CreationTimestamp: Sun, 19 Jul 2020 15:59:37 +0200
    5. Requesting User: system:serviceaccount:openshift-machine-config-operator:node-bootstrapper
    6. Signer: kubernetes.io/kube-apiserver-client-kubelet
    7. Status: Pending
    8. Subject:
    9. Common Name: system:node:ocp4-lk6b4-worker1.ocp4.example.org
    10. Serial Number:
    11. Organization: system:nodes
    12. Events: <none>
  5. If the CSR information is correct, approve the request:

    1. $ oc adm certificate approve csr-m724n
  6. Wait for the installation process to finish:

    1. $ 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.

Additional resources

Disabling the default OperatorHub catalog sources

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.

Procedure

  • Disable the sources for the default catalogs by adding disableAllDefaultSources: true to the OperatorHub object:

    1. $ oc patch OperatorHub cluster --type json \
    2. -p '[{"op": "add", "path": "/spec/disableAllDefaultSources", "value": true}]'

Alternatively, you can use the web console to manage catalog sources. From the AdministrationCluster SettingsConfigurationOperatorHub page, click the Sources tab, where you can create, delete, disable, and enable individual sources.