Este contenido no está disponible en el idioma seleccionado.
Chapter 17. Installation configuration
17.1. Customizing nodes Copiar enlaceEnlace copiado en el portapapeles!
Although directly making changes to OpenShift Container Platform nodes is discouraged, there are times when it is necessary to implement a required low-level security, redundancy, networking, or performance feature. Direct changes to OpenShift Container Platform nodes can be done by:
-
Creating machine configs that are included in manifest files to start up a cluster during .
openshift-install - Creating machine configs that are passed to running OpenShift Container Platform nodes via the Machine Config Operator.
-
Creating an Ignition config that is passed to when installing bare-metal nodes.
coreos-installer
The following sections describe features that you might want to configure on your nodes in this way.
17.1.1. Creating machine configs with Butane Copiar enlaceEnlace copiado en el portapapeles!
Machine configs are used to configure control plane and worker machines by instructing machines how to create users and file systems, set up the network, install systemd units, and more.
Because modifying machine configs can be difficult, you can use Butane configs to create machine configs for you, thereby making node configuration much easier.
17.1.1.1. About Butane Copiar enlaceEnlace copiado en el portapapeles!
Butane is a command-line utility that OpenShift Container Platform uses to provide convenient, short-hand syntax for writing machine configs, as well as for performing additional validation of machine configs. The format of the Butane config file that Butane accepts is defined in the OpenShift Butane config spec.
17.1.1.2. Installing Butane Copiar enlaceEnlace copiado en el portapapeles!
You can install the Butane tool (
butane
butane
Butane releases are backwards-compatible with older releases and with the Fedora CoreOS Config Transpiler (FCCT).
Procedure
- Navigate to the Butane image download page at https://mirror.openshift.com/pub/openshift-v4/clients/butane/.
Get the
binary:butaneFor the newest version of Butane, save the latest
image to your current directory:butane$ curl https://mirror.openshift.com/pub/openshift-v4/clients/butane/latest/butane --output butaneOptional: For a specific type of architecture you are installing Butane on, such as aarch64 or ppc64le, indicate the appropriate URL. For example:
$ curl https://mirror.openshift.com/pub/openshift-v4/clients/butane/latest/butane-aarch64 --output butane
Make the downloaded binary file executable:
$ chmod +x butaneMove the
binary file to a directory on yourbutane.PATHTo check your
, open a terminal and execute the following command:PATH$ echo $PATH
Verification steps
You can now use the Butane tool by running the
command:butane$ butane <butane_file>
17.1.1.3. Creating a MachineConfig object by using Butane Copiar enlaceEnlace copiado en el portapapeles!
You can use Butane to produce a
MachineConfig
Prerequisites
-
You have installed the utility.
butane
Procedure
Create a Butane config file. The following example creates a file named
that configures the system console to show kernel debug messages and specifies custom settings for the chrony time service:99-worker-custom.buvariant: openshift version: 4.8.0 metadata: name: 99-worker-custom labels: machineconfiguration.openshift.io/role: worker openshift: kernel_arguments: - loglevel=7 storage: files: - path: /etc/chrony.conf mode: 0644 overwrite: true contents: inline: | pool 0.rhel.pool.ntp.org iburst driftfile /var/lib/chrony/drift makestep 1.0 3 rtcsync logdir /var/log/chronyNoteThe
file is set to create a machine config for worker nodes. To deploy on control plane nodes, change the role from99-worker-custom.butoworker. To do both, you could repeat the whole procedure using different file names for the two types of deployments.masterCreate a
object by giving Butane the file that you created in the previous step:MachineConfig$ butane 99-worker-custom.bu -o ./99-worker-custom.yamlA
object YAML file is created for you to finish configuring your machines.MachineConfig-
Save the Butane config in case you need to update the object in the future.
MachineConfig If the cluster is not running yet, generate manifest files and add the
object YAML file to theMachineConfigdirectory. If the cluster is already running, apply the file as follows:openshift$ oc create -f 99-worker-custom.yaml
17.1.2. Adding day-1 kernel arguments Copiar enlaceEnlace copiado en el portapapeles!
Although it is often preferable to modify kernel arguments as a day-2 activity, you might want to add kernel arguments to all master or worker nodes during initial cluster installation. Here are some reasons you might want to add kernel arguments during cluster installation so they take effect before the systems first boot up:
- You want to disable a feature, such as SELinux, so it has no impact on the systems when they first come up.
Disabling SELinux on RHCOS is not supported.
- You need to do some low-level network configuration before the systems start.
To add kernel arguments to master or worker nodes, you can create a
MachineConfig
For a listing of arguments you can pass to a RHEL 8 kernel at boot time, see Kernel.org kernel parameters. It is best to only add kernel arguments with this procedure if they are needed to complete the initial OpenShift Container Platform installation.
Procedure
Change to the directory that contains the installation program and generate the Kubernetes manifests for the cluster:
$ ./openshift-install create manifests --dir <installation_directory>- Decide if you want to add kernel arguments to worker or control plane nodes (also known as the master nodes).
In the
directory, create a file (for example,openshift) to define a99-openshift-machineconfig-master-kargs.yamlobject to add the kernel settings. This example adds aMachineConfigkernel argument to control plane nodes:loglevel=7$ cat << EOF > 99-openshift-machineconfig-master-kargs.yaml apiVersion: machineconfiguration.openshift.io/v1 kind: MachineConfig metadata: labels: machineconfiguration.openshift.io/role: master name: 99-openshift-machineconfig-master-kargs spec: kernelArguments: - loglevel=7 EOFYou can change
tomasterto add kernel arguments to worker nodes instead. Create a separate YAML file to add to both master and worker nodes.worker
You can now continue on to create the cluster.
17.1.3. Adding kernel modules to nodes Copiar enlaceEnlace copiado en el portapapeles!
For most common hardware, the Linux kernel includes the device driver modules needed to use that hardware when the computer starts up. For some hardware, however, modules are not available in Linux. Therefore, you must find a way to provide those modules to each host computer. This procedure describes how to do that for nodes in an OpenShift Container Platform cluster.
When a kernel module is first deployed by following these instructions, the module is made available for the current kernel. If a new kernel is installed, the kmods-via-containers software will rebuild and deploy the module so a compatible version of that module is available with the new kernel.
The way that this feature is able to keep the module up to date on each node is by:
- Adding a systemd service to each node that starts at boot time to detect if a new kernel has been installed and
- If a new kernel is detected, the service rebuilds the module and installs it to the kernel
For information on the software needed for this procedure, see the kmods-via-containers github site.
A few important issues to keep in mind:
- This procedure is Technology Preview.
-
Software tools and examples are not yet available in official RPM form and can only be obtained for now from unofficial sites noted in the procedure.
github.com - Third-party kernel modules you might add through these procedures are not supported by Red Hat.
-
In this procedure, the software needed to build your kernel modules is deployed in a RHEL 8 container. Keep in mind that modules are rebuilt automatically on each node when that node gets a new kernel. For that reason, each node needs access to a repository that contains the kernel and related packages needed to rebuild the module. That content is best provided with a valid RHEL subscription.
yum
17.1.3.1. Building and testing the kernel module container Copiar enlaceEnlace copiado en el portapapeles!
Before deploying kernel modules to your OpenShift Container Platform cluster, you can test the process on a separate RHEL system. Gather the kernel module’s source code, the KVC framework, and the kmod-via-containers software. Then build and test the module. To do that on a RHEL 8 system, do the following:
Procedure
Register a RHEL 8 system:
# subscription-manager registerAttach a subscription to the RHEL 8 system:
# subscription-manager attach --autoInstall software that is required to build the software and container:
# yum install podman make git -yClone the
repository:kmod-via-containersCreate a folder for the repository:
$ mkdir kmods; cd kmodsClone the repository:
$ git clone https://github.com/kmods-via-containers/kmods-via-containers
Install a KVC framework instance on your RHEL 8 build host to test the module. This adds a
systemd service and loads it:kmods-via-containerChange to the
directory:kmod-via-containers$ cd kmods-via-containers/Install the KVC framework instance:
$ sudo make installReload the systemd manager configuration:
$ sudo systemctl daemon-reload
Get the kernel module source code. The source code might be used to build a third-party module that you do not have control over, but is supplied by others. You will need content similar to the content shown in the
example that can be cloned to your system as follows:kvc-simple-kmod$ cd .. ; git clone https://github.com/kmods-via-containers/kvc-simple-kmodEdit the configuration file,
file, in this example, and change the name of the Dockerfile tosimple-kmod.conf:Dockerfile.rhelChange to the
directory:kvc-simple-kmod$ cd kvc-simple-kmodRename the Dockerfile:
$ cat simple-kmod.confExample Dockerfile
KMOD_CONTAINER_BUILD_CONTEXT="https://github.com/kmods-via-containers/kvc-simple-kmod.git" KMOD_CONTAINER_BUILD_FILE=Dockerfile.rhel KMOD_SOFTWARE_VERSION=dd1a7d4 KMOD_NAMES="simple-kmod simple-procfs-kmod"
Create an instance of
for your kernel module,kmods-via-containers@.servicein this example:simple-kmod$ sudo make installEnable the
instance:kmods-via-containers@.service$ sudo kmods-via-containers build simple-kmod $(uname -r)Enable and start the systemd service:
$ sudo systemctl enable kmods-via-containers@simple-kmod.service --nowReview the service status:
$ sudo systemctl status kmods-via-containers@simple-kmod.serviceExample output
● kmods-via-containers@simple-kmod.service - Kmods Via Containers - simple-kmod Loaded: loaded (/etc/systemd/system/kmods-via-containers@.service; enabled; vendor preset: disabled) Active: active (exited) since Sun 2020-01-12 23:49:49 EST; 5s ago...
To confirm that the kernel modules are loaded, use the
command to list the modules:lsmod$ lsmod | grep simple_Example output
simple_procfs_kmod 16384 0 simple_kmod 16384 0Optional. Use other methods to check that the
example is working:simple-kmodLook for a "Hello world" message in the kernel ring buffer with
:dmesg$ dmesg | grep 'Hello world'Example output
[ 6420.761332] Hello world from simple_kmod.Check the value of
insimple-procfs-kmod:/proc$ sudo cat /proc/simple-procfs-kmodExample output
simple-procfs-kmod number = 0Run the
command to get more information from the module:spkut$ sudo spkut 44Example output
KVC: wrapper simple-kmod for 4.18.0-147.3.1.el8_1.x86_64 Running userspace wrapper using the kernel module container... + podman run -i --rm --privileged simple-kmod-dd1a7d4:4.18.0-147.3.1.el8_1.x86_64 spkut 44 simple-procfs-kmod number = 0 simple-procfs-kmod number = 44
Going forward, when the system boots this service will check if a new kernel is running. If there is a new kernel, the service builds a new version of the kernel module and then loads it. If the module is already built, it will just load it.
17.1.3.2. Provisioning a kernel module to OpenShift Container Platform Copiar enlaceEnlace copiado en el portapapeles!
Depending on whether or not you must have the kernel module in place when OpenShift Container Platform cluster first boots, you can set up the kernel modules to be deployed in one of two ways:
-
Provision kernel modules at cluster install time (day-1): You can create the content as a object and provide it to
MachineConfigby including it with a set of manifest files.openshift-install - Provision kernel modules via Machine Config Operator (day-2): If you can wait until the cluster is up and running to add your kernel module, you can deploy the kernel module software via the Machine Config Operator (MCO).
In either case, each node needs to be able to get the kernel packages and related software packages at the time that a new kernel is detected. There are a few ways you can set up each node to be able to obtain that content.
- Provide RHEL entitlements to each node.
-
Get RHEL entitlements from an existing RHEL host, from the directory and copy them to the same location as the other files you provide when you build your Ignition config.
/etc/pki/entitlement -
Inside the Dockerfile, add pointers to a repository containing the kernel and other packages. This must include new kernel packages as they are needed to match newly installed kernels.
yum
17.1.3.2.1. Provision kernel modules via a MachineConfig object Copiar enlaceEnlace copiado en el portapapeles!
By packaging kernel module software with a
MachineConfig
Procedure
Register a RHEL 8 system:
# subscription-manager registerAttach a subscription to the RHEL 8 system:
# subscription-manager attach --autoInstall software needed to build the software:
# yum install podman make git -yCreate a directory to host the kernel module and tooling:
$ mkdir kmods; cd kmodsGet the
software:kmods-via-containersClone the
repository:kmods-via-containers$ git clone https://github.com/kmods-via-containers/kmods-via-containersClone the
repository:kvc-simple-kmod$ git clone https://github.com/kmods-via-containers/kvc-simple-kmod
-
Get your module software. In this example, is used.
kvc-simple-kmod Create a fakeroot directory and populate it with files that you want to deliver via Ignition, using the repositories cloned earlier:
Create the directory:
$ FAKEROOT=$(mktemp -d)Change to the
directory:kmod-via-containers$ cd kmods-via-containersInstall the KVC framework instance:
$ make install DESTDIR=${FAKEROOT}/usr/local CONFDIR=${FAKEROOT}/etc/Change to the
directory:kvc-simple-kmod$ cd ../kvc-simple-kmodCreate the instance:
$ make install DESTDIR=${FAKEROOT}/usr/local CONFDIR=${FAKEROOT}/etc/
Clone the fakeroot directory, replacing any symbolic links with copies of their targets, by running the following command:
$ cd .. && rm -rf kmod-tree && cp -Lpr ${FAKEROOT} kmod-treeCreate a Butane config file,
, that embeds the kernel module tree and enables the systemd service.99-simple-kmod.buNoteSee "Creating machine configs with Butane" for information about Butane.
variant: openshift version: 4.8.0 metadata: name: 99-simple-kmod labels: machineconfiguration.openshift.io/role: worker1 storage: trees: - local: kmod-tree systemd: units: - name: kmods-via-containers@simple-kmod.service enabled: true- 1
- To deploy on control plane nodes, change
workertomaster. To deploy on both control plane and worker nodes, perform the remainder of these instructions once for each node type.
Use Butane to generate a machine config YAML file,
, containing the files and configuration to be delivered:99-simple-kmod.yaml$ butane 99-simple-kmod.bu --files-dir . -o 99-simple-kmod.yamlIf the cluster is not up yet, generate manifest files and add this file to the
directory. If the cluster is already running, apply the file as follows:openshift$ oc create -f 99-simple-kmod.yamlYour nodes will start the
service and the kernel modules will be loaded.kmods-via-containers@simple-kmod.serviceTo confirm that the kernel modules are loaded, you can log in to a node (using
, thenoc debug node/<openshift-node>). To list the modules, use thechroot /hostcommand:lsmod$ lsmod | grep simple_Example output
simple_procfs_kmod 16384 0 simple_kmod 16384 0
17.1.4. Encrypting and mirroring disks during installation Copiar enlaceEnlace copiado en el portapapeles!
During an OpenShift Container Platform installation, you can enable boot disk encryption and mirroring on the cluster nodes.
17.1.4.1. About disk encryption Copiar enlaceEnlace copiado en el portapapeles!
You can enable encryption for the boot disks on the control plane and compute nodes at installation time. OpenShift Container Platform supports the Trusted Platform Module (TPM) v2 and Tang encryption modes.
- TPM v2: This is the preferred mode. TPM v2 stores passphrases in a secure cryptoprocessor contained within a server. You can use this mode to prevent the boot disk data on a cluster node from being decrypted if the disk is removed from the server.
- Tang: Tang and Clevis are server and client components that enable network-bound disk encryption (NBDE). You can bind the boot disk data on your cluster nodes to one or more Tang servers. This prevents the data from being decrypted unless the nodes are on a secure network where the Tang servers can be accessed. Clevis is an automated decryption framework that is used to implement the decryption on the client side.
The use of the Tang encryption mode to encrypt your disks is only supported for bare metal and vSphere installations on user-provisioned infrastructure.
On previous versions of Red Hat Enterprise Linux CoreOS (RHCOS), disk encryption was configured by specifying
/etc/clevis.json
When the TPM v2 or Tang encryption modes are enabled, the RHCOS boot disks are encrypted using the LUKS2 format.
This feature:
- Is available for installer-provisioned infrastructure and user-provisioned infrastructure deployments
- Is supported on Red Hat Enterprise Linux CoreOS (RHCOS) systems only
- Sets up disk encryption during the manifest installation phase so all data written to disk, from first boot forward, is encrypted
- Requires no user intervention for providing passphrases
- Uses AES-256-XTS encryption, or AES-256-CBC if FIPS mode is enabled
17.1.4.1.1. Configuring an encryption threshold Copiar enlaceEnlace copiado en el portapapeles!
In OpenShift Container Platform, you can specify a requirement for more than one Tang server. You can also configure the TPM v2 and Tang encryption modes simultaneously, so that the boot disk data can be decrypted only if the TPM secure cryptoprocessor is present and the Tang servers can be accessed over a secure network.
You can use the
threshold
threshold
2
Example Butane configuration for disk encryption
variant: openshift
version: 4.8.0
metadata:
name: worker-storage
labels:
machineconfiguration.openshift.io/role: worker
boot_device:
layout: x86_64
luks:
tpm2: true
tang:
- url: http://tang1.example.com:7500
thumbprint: jwGN5tRFK-kF6pIX89ssF3khxxX
- url: http://tang2.example.com:7500
thumbprint: VCJsvZFjBSIHSldw78rOrq7h2ZF
threshold: 2
openshift:
fips: true
The default
threshold
1
If you require both TPM v2 and Tang for decryption, the value of the
threshold
threshold
tpm2
true
2
17.1.4.2. About disk mirroring Copiar enlaceEnlace copiado en el portapapeles!
During OpenShift Container Platform installation on control plane and worker nodes, you can enable mirroring of the boot and other disks to two or more redundant storage devices. A node continues to function after storage device failure as long as one device remains available.
Mirroring does not support replacement of a failed disk. To restore the mirror to a pristine, non-degraded state, reprovision the node.
Mirroring is available only for user-provisioned infrastructure deployments on RHCOS systems. Mirroring support is available on x86_64 nodes booted with BIOS or UEFI and on ppc64le nodes.
17.1.4.3. Configuring disk encryption and mirroring Copiar enlaceEnlace copiado en el portapapeles!
You can enable and configure encryption and mirroring during an OpenShift Container Platform installation.
Prerequisites
- You have downloaded the OpenShift Container Platform installation program on your installation node.
You installed Butane on your installation node.
NoteButane is a command-line utility that OpenShift Container Platform uses to provide convenient, short-hand syntax for writing machine configs, as well as for performing additional validation of machine configs. For more information, see the Creating machine configs with Butane section.
- You have access to a Red Hat Enterprise Linux (RHEL) 8 machine that can be used to generate a thumbprint of the Tang exchange key.
Procedure
- If you want to use TPM v2 to encrypt your cluster, check to see if TPM v2 encryption needs to be enabled in the BIOS on each node. This is required on most Dell systems. Check the manual for your computer.
If you want to use Tang to encrypt your cluster, follow these preparatory steps:
- Set up a Tang server or access an existing one. See Network-bound disk encryption for instructions.
Install the
package on a RHEL 8 machine, if it is not already installed:clevis$ sudo yum install clevisOn the RHEL 8 machine, run the following command to generate a thumbprint of the exchange key. Replace
with the URL of your Tang server:http://tang.example.com:7500$ clevis-encrypt-tang '{"url":"http://tang.example.com:7500"}' < /dev/null > /dev/null1 - 1
- In this example,
tangd.socketis listening on port7500on the Tang server.
NoteThe
command is used in this step only to generate a thumbprint of the exchange key. No data is being passed to the command for encryption at this point, soclevis-encrypt-tangis provided as an input instead of plain text. The encrypted output is also sent to/dev/null, because it is not required for this procedure./dev/nullExample output
The advertisement contains the following signing keys: PLjNyRdGw03zlRoGjQYMahSZGu91 - 1
- The thumbprint of the exchange key.
When the
prompt displays, typeDo you wish to trust these keys? [ynYN].YNoteRHEL 8 provides Clevis version 15, which uses the SHA-1 hash algorithm to generate thumbprints. Some other distributions provide Clevis version 17 or later, which use the SHA-256 hash algorithm for thumbprints. You must use a Clevis version that uses SHA-1 to create the thumbprint, to prevent Clevis binding issues when you install Red Hat Enterprise Linux CoreOS (RHCOS) on your OpenShift Container Platform cluster nodes.
If the nodes are configured with static IP addressing, use the
coreos-installeroption when installing RHCOS nodes to set the IP address of the installed system. Append the--append-kargand other arguments needed for your network.ip=ImportantSome methods for configuring static IPs do not affect the initramfs after the first boot and will not work with Tang encryption. These include the
coreos-installeroption, as well as adding--copy-networkarguments to the kernel command line of the live ISO or PXE image during installation. Incorrect static IP configuration causes the second boot of the node to fail.ip=
On your installation node, change to the directory that contains the installation program and generate the Kubernetes manifests for the cluster:
$ ./openshift-install create manifests --dir <installation_directory>1 - 1
- Replace
<installation_directory>with the path to the directory that you want to store the installation files in.
Create a Butane config that configures disk encryption, mirroring, or both. For example, to configure storage for compute nodes, create a
file.$HOME/clusterconfig/worker-storage.buButane config example for a boot device
variant: openshift version: 4.8.0 metadata: name: worker-storage1 labels: machineconfiguration.openshift.io/role: worker2 boot_device: layout: x86_643 luks:4 tpm2: true5 tang:6 - url: http://tang.example.com:75007 thumbprint: PLjNyRdGw03zlRoGjQYMahSZGu98 threshold: 19 mirror:10 devices:11 - /dev/sda - /dev/sdb openshift: fips: true12 - 1 2
- For control plane configurations, replace
workerwithmasterin both of these locations. - 3
- On ppc64le nodes, set this field to
ppc64le. On all other nodes, this field can be omitted. - 4
- Include this section if you want to encrypt the root file system. For more details, see the About disk encryption section.
- 5
- Include this field if you want to use a Trusted Platform Module (TPM) to encrypt the root file system.
- 6
- Include this section if you want to use one or more Tang servers.
- 7
- Specify the URL of a Tang server. In this example,
tangd.socketis listening on port7500on the Tang server. - 8
- Specify the exchange key thumbprint, which was generated in a preceding step.
- 9
- Specify the minimum number of TPM v2 and Tang encryption conditions that must be met for decryption to occur. The default value is
1. For more information on this topic, see the Configuring an encryption threshold section. - 10
- Include this section if you want to mirror the boot disk. For more details, see About disk mirroring.
- 11
- List all disk devices that should be included in the boot disk mirror, including the disk that RHCOS will be installed onto.
- 12
- Include this directive to enable FIPS mode on your cluster.
ImportantIf you are configuring nodes to use both disk encryption and mirroring, both features must be configured in the same Butane config. In addition, if you are configuring disk encryption on a node with FIPS mode enabled, you must include the
directive in the same Butane config, even if FIPS mode is also enabled in a separate manifest.fipsCreate a control plane or compute node manifest from the corresponding Butane config and save it to the
directory. For example, to create a manifest for the compute nodes, run the following command:<installation_directory>/openshift$ butane $HOME/clusterconfig/worker-storage.bu -o <installation_directory>/openshift/99-worker-storage.yamlRepeat this step for each node type that requires disk encryption or mirroring.
- Save the Butane configs in case you need to update the manifests in the future.
Continue with the remainder of the OpenShift Container Platform installation.
TipYou can monitor the console log on the RHCOS nodes during installation for error messages relating to disk encryption or mirroring.
ImportantIf you configure additional data partitions, they will not be encrypted unless encryption is explicitly requested.
Verification
After installing OpenShift Container Platform, you can verify if boot disk encryption or mirroring is enabled on the cluster nodes.
From the installation host, access a cluster node by using a debug pod:
Start a debug pod for the node. The following example starts a debug pod for the
node:compute-1$ oc debug node/compute-1Set
as the root directory within the debug shell. The debug pod mounts the root file system of the node in/hostwithin the pod. By changing the root directory to/host, you can run binaries contained in the executable paths on the node:/host# chroot /hostNoteOpenShift Container Platform cluster nodes running Red Hat Enterprise Linux CoreOS (RHCOS) are immutable and rely on Operators to apply cluster changes. Accessing cluster nodes using SSH is not recommended. However, if the OpenShift Container Platform API is not available, or
is not properly functioning on the target node,kubeletoperations will be impacted. In such situations, it is possible to access nodes usingocinstead.ssh core@<node>.<cluster_name>.<base_domain>
If you configured boot disk encryption, verify if it is enabled:
From the debug shell, review the status of the root mapping on the node:
# cryptsetup status rootExample output
/dev/mapper/root is active and is in use. type: LUKS21 cipher: aes-xts-plain642 keysize: 512 bits key location: keyring device: /dev/sda43 sector size: 512 offset: 32768 sectors size: 15683456 sectors mode: read/write- 1
- The encryption format. When the TPM v2 or Tang encryption modes are enabled, the RHCOS boot disks are encrypted using the LUKS2 format.
- 2
- The encryption algorithm used to encrypt the LUKS2 volume. The
aes-cbc-essiv:sha256cipher is used if FIPS mode is enabled. - 3
- The device that contains the encrypted LUKS2 volume. If mirroring is enabled, the value will represent a software mirror device, for example
/dev/md126.
List the Clevis plugins that are bound to the encrypted device:
# clevis luks list -d /dev/sda41 - 1
- Specify the device that is listed in the
devicefield in the output of the preceding step.
Example output
1: sss '{"t":1,"pins":{"tang":[{"url":"http://tang.example.com:7500"}]}}'1 - 1
- In the example output, the Tang plugin is used by the Shamir’s Secret Sharing (SSS) Clevis plugin for the
/dev/sda4device.
If you configured mirroring, verify if it is enabled:
From the debug shell, list the software RAID devices on the node:
# cat /proc/mdstatExample output
Personalities : [raid1] md126 : active raid1 sdb3[1] sda3[0]1 393152 blocks super 1.0 [2/2] [UU] md127 : active raid1 sda4[0] sdb4[1]2 51869632 blocks super 1.2 [2/2] [UU] unused devices: <none>Review the details of each of the software RAID devices listed in the output of the preceding command. The following example lists the details of the
device:/dev/md126# mdadm --detail /dev/md126Example output
/dev/md126: Version : 1.0 Creation Time : Wed Jul 7 11:07:36 2021 Raid Level : raid11 Array Size : 393152 (383.94 MiB 402.59 MB) Used Dev Size : 393152 (383.94 MiB 402.59 MB) Raid Devices : 2 Total Devices : 2 Persistence : Superblock is persistent Update Time : Wed Jul 7 11:18:24 2021 State : clean2 Active Devices : 23 Working Devices : 24 Failed Devices : 05 Spare Devices : 0 Consistency Policy : resync Name : any:md-boot6 UUID : ccfa3801:c520e0b5:2bee2755:69043055 Events : 19 Number Major Minor RaidDevice State 0 252 3 0 active sync /dev/sda37 1 252 19 1 active sync /dev/sdb38 - 1
- Specifies the RAID level of the device.
raid1indicates RAID 1 disk mirroring. - 2
- Specifies the state of the RAID device.
- 3 4
- States the number of underlying disk devices that are active and working.
- 5
- States the number of underlying disk devices that are in a failed state.
- 6
- The name of the software RAID device.
- 7 8
- Provides information about the underlying disk devices that are used by the software RAID device.
List the file systems that are mounted on the software RAID devices:
# mount | grep /dev/mdExample output
/dev/md127 on / type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,prjquota) /dev/md127 on /etc type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,prjquota) /dev/md127 on /usr type xfs (ro,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,prjquota) /dev/md127 on /sysroot type xfs (ro,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,prjquota) /dev/md127 on /var type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,prjquota) /dev/md127 on /var/lib/containers/storage/overlay type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,prjquota) /dev/md127 on /var/lib/kubelet/pods/e5054ed5-f882-4d14-b599-99c050d4e0c0/volume-subpaths/etc/tuned/1 type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,prjquota) /dev/md127 on /var/lib/kubelet/pods/e5054ed5-f882-4d14-b599-99c050d4e0c0/volume-subpaths/etc/tuned/2 type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,prjquota) /dev/md127 on /var/lib/kubelet/pods/e5054ed5-f882-4d14-b599-99c050d4e0c0/volume-subpaths/etc/tuned/3 type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,prjquota) /dev/md127 on /var/lib/kubelet/pods/e5054ed5-f882-4d14-b599-99c050d4e0c0/volume-subpaths/etc/tuned/4 type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,prjquota) /dev/md127 on /var/lib/kubelet/pods/e5054ed5-f882-4d14-b599-99c050d4e0c0/volume-subpaths/etc/tuned/5 type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,prjquota) /dev/md126 on /boot type ext4 (rw,relatime,seclabel)In the example output, the
file system is mounted on the/bootsoftware RAID device and the root file system is mounted on/dev/md126./dev/md127
- Repeat the verification steps for each OpenShift Container Platform node type.
17.1.4.4. Configuring a RAID-enabled data volume Copiar enlaceEnlace copiado en el portapapeles!
You can enable software RAID partitioning to provide an external data volume. OpenShift Container Platform supports RAID 0, RAID 1, RAID 4, RAID 5, RAID 6, and RAID 10 for data protection and fault tolerance. See "About disk mirroring" for more details.
Prerequisites
- You have downloaded the OpenShift Container Platform installation program on your installation node.
You have installed Butane on your installation node.
NoteButane is a command-line utility that OpenShift Container Platform uses to provide convenient, short-hand syntax for writing machine configs, as well as for performing additional validation of machine configs. For more information, see the Creating machine configs with Butane section.
Procedure
Create a Butane config that configures a data volume by using software RAID.
To configure a data volume with RAID 1 on the same disks that are used for a mirrored boot disk, create a
file, for example:$HOME/clusterconfig/raid1-storage.buRAID 1 on mirrored boot disk
variant: openshift version: 4.8.0 metadata: name: raid1-storage labels: machineconfiguration.openshift.io/role: worker boot_device: mirror: devices: - /dev/sda - /dev/sdb storage: disks: - device: /dev/sda partitions: - label: root-1 size_mib: 250001 - label: var-1 - device: /dev/sdb partitions: - label: root-2 size_mib: 250002 - label: var-2 raid: - name: md-var level: raid1 devices: - /dev/disk/by-partlabel/var-1 - /dev/disk/by-partlabel/var-2 filesystems: - device: /dev/md/md-var path: /var format: xfs wipe_filesystem: true with_mount_unit: true- 1 2
- When adding a data partition to the boot disk, a minimum value of 25000 mebibytes is recommended. If no value is specified, or if the specified value is smaller than the recommended minimum, the resulting root file system will be too small, and future reinstalls of RHCOS might overwrite the beginning of the data partition.
To configure a data volume with RAID 1 on secondary disks, create a
file, for example:$HOME/clusterconfig/raid1-alt-storage.buRAID 1 on secondary disks
variant: openshift version: 4.8.0 metadata: name: raid1-alt-storage labels: machineconfiguration.openshift.io/role: worker storage: disks: - device: /dev/sdc wipe_table: true partitions: - label: data-1 - device: /dev/sdd wipe_table: true partitions: - label: data-2 raid: - name: md-var-lib-containers level: raid1 devices: - /dev/disk/by-partlabel/data-1 - /dev/disk/by-partlabel/data-2 filesystems: - device: /dev/md/md-var-lib-containers path: /var/lib/containers format: xfs wipe_filesystem: true with_mount_unit: true
Create a RAID manifest from the Butane config you created in the previous step and save it to the
directory. For example, to create a manifest for the compute nodes, run the following command:<installation_directory>/openshift$ butane $HOME/clusterconfig/<butane_config>.bu -o <installation_directory>/openshift/<manifest_name>.yaml1 - 1
- Replace
<butane_config>and<manifest_name>with the file names from the previous step. For example,raid1-alt-storage.buandraid1-alt-storage.yamlfor secondary disks.
- Save the Butane config in case you need to update the manifest in the future.
- Continue with the remainder of the OpenShift Container Platform installation.
17.1.5. Configuring chrony time service Copiar enlaceEnlace copiado en el portapapeles!
You can set the time server and related settings used by the chrony time service (
chronyd
chrony.conf
Procedure
Create a Butane config including the contents of the
file. For example, to configure chrony on worker nodes, create achrony.conffile.99-worker-chrony.buNoteSee "Creating machine configs with Butane" for information about Butane.
variant: openshift version: 4.8.0 metadata: name: 99-worker-chrony1 labels: machineconfiguration.openshift.io/role: worker2 storage: files: - path: /etc/chrony.conf mode: 06443 overwrite: true contents: inline: | pool 0.rhel.pool.ntp.org iburst4 driftfile /var/lib/chrony/drift makestep 1.0 3 rtcsync logdir /var/log/chrony- 1 2
- On control plane nodes, substitute
masterforworkerin both of these locations. - 3
- Specify an octal value mode for the
modefield in the machine config file. After creating the file and applying the changes, themodeis converted to a decimal value. You can check the YAML file with the commandoc get mc <mc-name> -o yaml. - 4
- Specify any valid, reachable time source, such as the one provided by your DHCP server. Alternately, you can specify any of the following NTP servers:
1.rhel.pool.ntp.org,2.rhel.pool.ntp.org, or3.rhel.pool.ntp.org.
Use Butane to generate a
object file,MachineConfig, containing the configuration to be delivered to the nodes:99-worker-chrony.yaml$ butane 99-worker-chrony.bu -o 99-worker-chrony.yamlApply the configurations in one of two ways:
-
If the cluster is not running yet, after you generate manifest files, add the object file to the
MachineConfigdirectory, and then continue to create the cluster.<installation_directory>/openshift If the cluster is already running, apply the file:
$ oc apply -f ./99-worker-chrony.yaml
-
If the cluster is not running yet, after you generate manifest files, add the
17.2. Configuring your firewall Copiar enlaceEnlace copiado en el portapapeles!
If you use a firewall, you must configure it so that OpenShift Container Platform can access the sites that it requires to function. You must always grant access to some sites, and you grant access to more if you use Red Hat Insights, the Telemetry service, a cloud to host your cluster, and certain build strategies.
17.2.1. Configuring your firewall for OpenShift Container Platform Copiar enlaceEnlace copiado en el portapapeles!
Before you install OpenShift Container Platform, you must configure your firewall to grant access to the sites that OpenShift Container Platform requires.
There are no special configuration considerations for services running on only controller nodes versus worker nodes.
Procedure
Allowlist the following registry URLs:
Expand URL Port Function registry.redhat.io443, 80
Provides core container images
access.redhat.com443, 80
Provides core container images
quay.io443, 80
Provides core container images
cdn.quay.io443, 80
Provides core container images
cdn01.quay.io443, 80
Provides core container images
cdn02.quay.io443, 80
Provides core container images
cdn03.quay.io443, 80
Provides core container images
sso.redhat.com443, 80
The
site uses authentication fromhttps://console.redhat.com/openshiftsso.redhat.comYou can use the wildcard
instead of*.quay.ioin your allowlist. When you add a site, such ascdn0[1-3].quay.io, to your allowlist, do not add a wildcard entry, such asquay.io, to your denylist. In most cases, image registries use a content delivery network (CDN) to serve images. If a firewall blocks access, image downloads are denied when the initial download request redirects to a hostname such as*.quay.io.cdn01.quay.io- Allowlist any site that provides resources for a language or framework that your builds require.
If you do not disable Telemetry, you must grant access to the following URLs to access Red Hat Insights:
Expand URL Port Function cert-api.access.redhat.com443, 80
Required for Telemetry
api.access.redhat.com443, 80
Required for Telemetry
infogw.api.openshift.com443, 80
Required for Telemetry
,console.redhat.com/api/ingresscloud.redhat.com/api/ingress443, 80
Required for Telemetry and for
insights-operatorIf you use Amazon Web Services (AWS), Microsoft Azure, or Google Cloud Platform (GCP) to host your cluster, you must grant access to the URLs that provide the cloud provider API and DNS for that cloud:
Expand Cloud URL Port Function AWS
*.amazonaws.com443, 80
Required to access AWS services and resources. Review the AWS Service Endpoints in the AWS documentation to determine the exact endpoints to allow for the regions that you use.
GCP
*.googleapis.com443, 80
Required to access GCP services and resources. Review Cloud Endpoints in the GCP documentation to determine the endpoints to allow for your APIs.
accounts.google.com443, 80
Required to access your GCP account.
Azure
management.azure.com443, 80
Required to access Azure services and resources. Review the Azure REST API reference in the Azure documentation to determine the endpoints to allow for your APIs.
*.blob.core.windows.net443, 80
Required to download Ignition files.
login.microsoftonline.com443, 80
Required to access Azure services and resources. Review the Azure REST API reference in the Azure documentation to determine the endpoints to allow for your APIs.
Allowlist the following URLs:
Expand URL Port Function mirror.openshift.com443, 80
Required to access mirrored installation content and images. This site is also a source of release image signatures, although the Cluster Version Operator needs only a single functioning source.
storage.googleapis.com/openshift-release443, 80
A source of release image signatures, although the Cluster Version Operator needs only a single functioning source.
*.apps.<cluster_name>.<base_domain>443, 80
Required to access the default cluster routes unless you set an ingress wildcard during installation.
quayio-production-s3.s3.amazonaws.com443, 80
Required to access Quay image content in AWS.
api.openshift.com443, 80
Required both for your cluster token and to check if updates are available for the cluster.
,rhcos-redirector.apps.art.xq1c.p1.openshiftapps.comrhcos.mirror.openshift.com443, 80
Required to download Red Hat Enterprise Linux CoreOS (RHCOS) images.
console.redhat.com/openshift443, 80
Required for your cluster token.
registry.access.redhat.com443, 80
Required for
CLI.odosso.redhat.com443, 80
The
site uses authentication fromhttps://console.redhat.com/openshiftsso.redhat.comOperators require route access to perform health checks. Specifically, the authentication and web console Operators connect to two routes to verify that the routes work. If you are the cluster administrator and do not want to allow
, then allow these routes:*.apps.<cluster_name>.<base_domain>-
oauth-openshift.apps.<cluster_name>.<base_domain> -
, or the hostname that is specified in the
console-openshift-console.apps.<cluster_name>.<base_domain>field of thespec.route.hostnameobject if the field is not empty.consoles.operator/cluster
-
Allowlist the following URLs for optional third-party content:
Expand URL Port Function registry.connect.redhat.com443, 80
Required for all third-party images and certified operators.
rhc4tp-prod-z8cxf-image-registry-us-east-1-evenkyleffocxqvofrk.s3.dualstack.us-east-1.amazonaws.com443, 80
Provides access to container images hosted on
registry.connect.redhat.comoso-rhc4tp-docker-registry.s3-us-west-2.amazonaws.com443, 80
Required for Sonatype Nexus, F5 Big IP operators.
If you use a default Red Hat Network Time Protocol (NTP) server allow the following URLs:
-
1.rhel.pool.ntp.org -
2.rhel.pool.ntp.org -
3.rhel.pool.ntp.org
-
If you do not use a default Red Hat NTP server, verify the NTP server for your platform and allow it in your firewall.