Customizing nodes

Although directly making changes to OKD 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 OKD 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 OKD nodes via the Machine Config Operator.

  • Creating an Ignition config that is passed to coreos-installer when installing bare-metal nodes.

The following sections describe features that you might want to configure on your nodes in this way.

Adding day-1 kernel arguments

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.

  • 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 object and inject that object into the set of manifest files used by Ignition during cluster setup.

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

Procedure

  1. Change to the directory that contains the installation program and generate the Kubernetes manifests for the cluster:

    1. $ ./openshift-install create manifests --dir=<installation_directory>
  2. Decide if you want to add kernel arguments to worker or control plane nodes (also known as the master nodes).

  3. In the openshift directory, create a file (for example, 99-openshift-machineconfig-master-kargs.yaml) to define a MachineConfig object to add the kernel settings. This example adds a loglevel=7 kernel argument to control plane nodes:

    1. $ cat << EOF > 99-openshift-machineconfig-master-kargs.yaml
    2. apiVersion: machineconfiguration.openshift.io/v1
    3. kind: MachineConfig
    4. metadata:
    5. labels:
    6. machineconfiguration.openshift.io/role: master
    7. name: 99-openshift-machineconfig-master-kargs
    8. spec:
    9. kernelArguments:
    10. - loglevel=7
    11. EOF

    You can change master to worker to add kernel arguments to worker nodes instead. Create a separate YAML file to add to both master and worker nodes.

You can now continue on to create the cluster.

Adding kernel modules to nodes

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 OKD 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 github.com sites noted in the procedure.

  • 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 yum repository that contains the kernel and related packages needed to rebuild the module. That content is best provided with a valid RHEL subscription.

Building and testing the kernel module container

Before deploying kernel modules to your OKD 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

  1. Register a RHEL 8 system:

    1. # subscription-manager register
  2. Attach a subscription to the RHEL 8 system:

    1. # subscription-manager attach --auto
  3. Install software that is required to build the software and container:

    1. # yum install podman make git -y
  4. Clone the kmod-via-containers repository:

    1. Create a folder for the repository:

      1. $ mkdir kmods; cd kmods
    2. Clone the repository:

      1. $ git clone https://github.com/kmods-via-containers/kmods-via-containers
  5. Install a KVC framework instance on your RHEL 8 build host to test the module. This adds a kmods-via-container systemd service and loads it:

    1. Change to the kmod-via-containers directory:

      1. $ cd kmods-via-containers/
    2. Install the KVC framework instance:

      1. $ sudo make install
    3. Reload the systemd manager configuration:

      1. $ sudo systemctl daemon-reload
  6. 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 kvc-simple-kmod example that can be cloned to your system as follows:

    1. $ cd .. ; git clone https://github.com/kmods-via-containers/kvc-simple-kmod
  7. Edit the configuration file, simple-kmod.conf file, in this example, and change the name of the Dockerfile to Dockerfile.rhel:

    1. Change to the kvc-simple-kmod directory:

      1. $ cd kvc-simple-kmod
    2. Rename the Dockerfile:

      1. $ cat simple-kmod.conf

      Example Dockerfile

      1. KMOD_CONTAINER_BUILD_CONTEXT="https://github.com/kmods-via-containers/kvc-simple-kmod.git"
      2. KMOD_CONTAINER_BUILD_FILE=Dockerfile.rhel
      3. KMOD_SOFTWARE_VERSION=dd1a7d4
      4. KMOD_NAMES="simple-kmod simple-procfs-kmod"
  8. Create an instance of kmods-via-containers@.service for your kernel module, simple-kmod in this example:

    1. $ sudo make install
  9. Enable the kmods-via-containers@.service instance:

    1. $ sudo kmods-via-containers build simple-kmod $(uname -r)
  10. Enable and start the systemd service:

    1. $ sudo systemctl enable kmods-via-containers@simple-kmod.service --now
    1. Review the service status:

      1. $ sudo systemctl status kmods-via-containers@simple-kmod.service

      Example output

      1. kmods-via-containers@simple-kmod.service - Kmods Via Containers - simple-kmod
      2. Loaded: loaded (/etc/systemd/system/kmods-via-containers@.service;
      3. enabled; vendor preset: disabled)
      4. Active: active (exited) since Sun 2020-01-12 23:49:49 EST; 5s ago...
  11. To confirm that the kernel modules are loaded, use the lsmod command to list the modules:

    1. $ lsmod | grep simple_

    Example output

    1. simple_procfs_kmod 16384 0
    2. simple_kmod 16384 0
  12. Optional. Use other methods to check that the simple-kmod example is working:

    • Look for a “Hello world” message in the kernel ring buffer with dmesg:

      1. $ dmesg | grep 'Hello world'

      Example output

      1. [ 6420.761332] Hello world from simple_kmod.
    • Check the value of simple-procfs-kmod in /proc:

      1. $ sudo cat /proc/simple-procfs-kmod

      Example output

      1. simple-procfs-kmod number = 0
    • Run the spkut command to get more information from the module:

      1. $ sudo spkut 44

      Example output

      1. KVC: wrapper simple-kmod for 4.18.0-147.3.1.el8_1.x86_64
      2. Running userspace wrapper using the kernel module container...
      3. + podman run -i --rm --privileged
      4. simple-kmod-dd1a7d4:4.18.0-147.3.1.el8_1.x86_64 spkut 44
      5. simple-procfs-kmod number = 0
      6. 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.

Provisioning a kernel module to OKD

Depending on whether or not you must have the kernel module in place when OKD 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 MachineConfig object and provide it to openshift-install by including it with a set of manifest files.

  • 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 /etc/pki/entitlement directory and copy them to the same location as the other files you provide when you build your Ignition config.

  • Inside the Dockerfile, add pointers to a yum repository containing the kernel and other packages. This must include new kernel packages as they are needed to match newly installed kernels.

Provision kernel modules via a MachineConfig object

By packaging kernel module software with a MachineConfig object, you can deliver that software to worker or master nodes at installation time or via the Machine Config Operator.

First create a base Ignition config that you would like to use. At installation time, the Ignition config will contain the ssh public key to add to the authorized_keys file for the core user on the cluster. To add the MachineConfig object later via the MCO instead, the SSH public key is not required. For both type, the example simple-kmod service creates a systemd unit file, which requires a kmods-via-containers@simple-kmod.service.

The systemd unit is a workaround for an upstream bug and makes sure that the kmods-via-containers@simple-kmod.service gets started on boot:

  1. Register a RHEL 8 system:

    1. # subscription-manager register
  2. Attach a subscription to the RHEL 8 system:

    1. # subscription-manager attach --auto
  3. Install software needed to build the software:

    1. # yum install podman make git -y
  4. Create an Ignition config file that creates a systemd unit file:

    1. Create a directory to host the Ignition config file:

      1. $ mkdir kmods; cd kmods
    2. Create the Ignition config file that creates a systemd unit file:

      1. $ cat <<EOF > ./baseconfig.ign
      2. {
      3. "ignition": { "version": "3.2.0" },
      4. "passwd": {
      5. "users": [
      6. {
      7. "name": "core",
      8. "groups": ["sudo"],
      9. "sshAuthorizedKeys": [
      10. "ssh-rsa AAAA"
      11. ]
      12. }
      13. ]
      14. },
      15. "systemd": {
      16. "units": [{
      17. "name": "require-kvc-simple-kmod.service",
      18. "enabled": true,
      19. "contents": "[Unit]\nRequires=kmods-via-containers@simple-kmod.service\n[Service]\nType=oneshot\nExecStart=/usr/bin/true\n\n[Install]\nWantedBy=multi-user.target"
      20. }]
      21. }
      22. }
      23. EOF

      You must add your public SSH key to the baseconfig.ign file to use the file during openshift-install. The public SSH key is not needed if you create the MachineConfig object using the MCO.

  5. Create a base MCO YAML snippet that uses the following configuration:

    1. $ cat <<EOF > mc-base.yaml
    2. apiVersion: machineconfiguration.openshift.io/v1
    3. kind: MachineConfig
    4. metadata:
    5. labels:
    6. machineconfiguration.openshift.io/role: worker
    7. name: 10-kvc-simple-kmod
    8. spec:
    9. config:
    10. EOF

    The mc-base.yaml is set to deploy the kernel module on worker nodes. To deploy on master nodes, change the role from worker to master. To do both, you could repeat the whole procedure using different file names for the two types of deployments.

  6. Get the kmods-via-containers software:

    1. Clone the kmods-via-containers repository:

      1. $ git clone https://github.com/kmods-via-containers/kmods-via-containers
    2. Clone the kvc-simple-kmod repository:

      1. $ git clone https://github.com/kmods-via-containers/kvc-simple-kmod
  7. Get your module software. In this example, kvc-simple-kmod is used:

  8. Create a fakeroot directory and populate it with files that you want to deliver via Ignition, using the repositories cloned earlier:

    1. Create the directory:

      1. $ FAKEROOT=$(mktemp -d)
    2. Change to the kmod-via-containers directory:

      1. $ cd kmods-via-containers
    3. Install the KVC framework instance:

      1. $ make install DESTDIR=${FAKEROOT}/usr/local CONFDIR=${FAKEROOT}/etc/
    4. Change to the kvc-simple-kmod directory:

      1. $ cd ../kvc-simple-kmod
    5. Create the instance:

      1. $ make install DESTDIR=${FAKEROOT}/usr/local CONFDIR=${FAKEROOT}/etc/
  9. Get a tool called filetranspiler and dependent software:

    1. $ cd .. ; sudo yum install -y python3
    2. git clone https://github.com/ashcrow/filetranspiler.git
  10. Generate a final machine config YAML (mc.yaml) and have it include the base Ignition config, base machine config, and the fakeroot directory with files you would like to deliver:

    1. $ ./filetranspiler/filetranspile -i ./baseconfig.ign \
    2. -f ${FAKEROOT} --format=yaml --dereference-symlinks \
    3. | sed 's/^/ /' | (cat mc-base.yaml -) > 99-simple-kmod.yaml
  11. If the cluster is not up yet, generate manifest files and add this file to the openshift directory. If the cluster is already running, apply the file as follows:

    1. $ oc create -f 99-simple-kmod.yaml

    Your nodes will start the kmods-via-containers@simple-kmod.service service and the kernel modules will be loaded.

  12. To confirm that the kernel modules are loaded, you can log in to a node (using oc debug node/<openshift-node>, then chroot /host). To list the modules, use the lsmod command:

    1. $ lsmod | grep simple_

    Example output

    1. simple_procfs_kmod 16384 0
    2. simple_kmod 16384 0

Encrypting disks during installation

You can enable encryption for the boot disks on the control plane and compute nodes at installation time. OKD 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 a Tang server. This prevents the data from being decrypted unless the nodes are on a secure network where the Tang server can be accessed. Clevis is an automated decryption framework that is used to implement the decryption on the client side.

The use of Tang encryption mode to encrypt your disks is only supported for bare metal and vSphere installations on user-provisioned infrastructure.

When the TPM v2 or Tang encryption modes are enabled, the FCOS boot disks are encrypted using the LUKS2 format.

This feature:

  • Is available for installer-provisioned infrastructure and user-provisioned infrastructure deployments

  • Is supported on Fedora CoreOS (FCOS) 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-CBC encryption

Follow one of the two procedures to enable disk encryption for the nodes in your cluster.

Enabling TPM v2 disk encryption

Use the following procedure to enable TPM v2 mode disk encryption during an OKD installation.

On previous versions of FCOS, disk encryption was configured by specifying /etc/clevis.json in the Ignition config. That file is not supported in clusters created with OKD 4.7 or above, and the LUKS device should be configured directly via the Ignition luks section.

Prerequisites

  • You have downloaded the OKD installation program on your installation node.

Procedure

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

  2. On your installation node, change to the directory that contains the installation program and generate the Kubernetes manifests for the cluster:

    1. $ ./openshift-install create manifests --dir=<installation_directory> (1)
    1Replace <installation_directory> with the path to the directory that you want to store the installation files in.
  3. Create machine config files to encrypt the boot disks for the control plane or compute nodes using the TPM v2 encryption mode.

    If you are also configuring boot disk mirroring on the affected nodes, skip this step. You will configure disk encryption when configuring boot disk mirroring.

    • To configure encryption on the control plane nodes, save the following machine config sample to a file in the <installation_directory>/openshift directory. For example, name the file 99-openshift-master-tpmv2-encryption.yaml:

      1. apiVersion: machineconfiguration.openshift.io/v1
      2. kind: MachineConfig
      3. metadata:
      4. name: master-tpm
      5. labels:
      6. machineconfiguration.openshift.io/role: master
      7. spec:
      8. config:
      9. ignition:
      10. version: 3.2.0
      11. storage:
      12. luks:
      13. - name: root
      14. device: /dev/disk/by-partlabel/root
      15. clevis:
      16. tpm2: true (1)
      17. options: [--cipher, aes-cbc-essiv:sha256]
      18. wipeVolume: true
      19. filesystems:
      20. - device: /dev/mapper/root
      21. format: xfs
      22. wipeFilesystem: true
      23. label: root
      1Set this attribute to true to use a Trusted Platform Module (TPM) secure cryptoprocessor to encrypt the root file system.
    • To configure encryption on the compute nodes, save the following machine config sample to a file in the <installation_directory>/openshift directory. For example, name the file 99-openshift-worker-tpmv2-encryption.yaml:

      1. apiVersion: machineconfiguration.openshift.io/v1
      2. kind: MachineConfig
      3. metadata:
      4. name: worker-tpm
      5. labels:
      6. machineconfiguration.openshift.io/role: worker
      7. spec:
      8. config:
      9. ignition:
      10. version: 3.2.0
      11. storage:
      12. luks:
      13. - name: root
      14. device: /dev/disk/by-partlabel/root
      15. clevis:
      16. tpm2: true (1)
      17. options: [--cipher, aes-cbc-essiv:sha256]
      18. wipeVolume: true
      19. filesystems:
      20. - device: /dev/mapper/root
      21. format: xfs
      22. wipeFilesystem: true
      23. label: root
      1Set this attribute to true to use a Trusted Platform Module (TPM) secure cryptoprocessor to encrypt the root file system.
  4. Create a backup copy of the YAML files. The original YAML files are consumed when you create the Ignition config files.

  5. Continue with the remainder of the OKD deployment.

If you configure additional data partitions, they will not be encrypted unless encryption is explicitly requested.

Enabling Tang disk encryption

Use the following procedure to enable Tang mode disk encryption during an OKD installation.

On previous versions of FCOS, disk encryption was configured by specifying /etc/clevis.json in the Ignition config. That file is not supported in clusters created with OKD 4.7 or above, and the LUKS device should be configured directly via the Ignition luks section.

Prerequisites

  • You have downloaded the OKD installation program on your installation node.

  • You have access to a Fedora 8 machine that can be used to generate a thumbprint of the Tang exchange key.

Procedure

  1. Set up a Tang server or access an existing one. See Network-bound disk encryption for instructions.

  2. Add kernel arguments to configure networking when you do the Fedora CoreOS (FCOS) installations for your cluster. For example, to configure DHCP networking, identify ip=dhcp, or set static networking when you add parameters to the kernel command line. For both DHCP and static networking, you also must provide the rd.neednet=1 kernel argument.

    Skipping this step causes the second boot to fail.

  3. Install the clevis package on a Fedora 8 machine, if it is not already installed:

    1. $ sudo yum install clevis
  4. On the Fedora 8 machine, run the following command to generate a thumbprint of the exchange key. Replace http://tang.example.com:7500 with the URL of your Tang server:

    1. $ clevis-encrypt-tang '{"url":"http://tang.example.com:7500"}' < /dev/null > /dev/null (1)
    1In this example, tangd.socket is listening on port 7500 on the Tang server.

    The clevis-encrypt-tang 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, so /dev/null is 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.

    Example output

    1. The advertisement contains the following signing keys:
    2. PLjNyRdGw03zlRoGjQYMahSZGu9 (1)
    1The thumbprint of the exchange key.

    When the Do you wish to trust these keys? [ynYN] prompt displays, type Y.

    Fedora 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 Fedora CoreOS (FCOS) on your OKD cluster nodes.

  5. If you have not yet generated the Kubernetes manifests, change to the directory that contains the installation program on your installation node and create them:

    1. $ ./openshift-install create manifests --dir=<installation_directory> (1)
    1Replace <installation_directory> with the path to the directory that you want to store the installation files in.
  6. Create machine config files to encrypt the boot disks for the control plane or compute nodes using the Tang encryption mode.

    If you are also configuring boot disk mirroring on the affected nodes, record the exchange key thumbprint for later use, and skip this step. You will configure disk encryption when configuring boot disk mirroring.

    • To configure encryption on the control plane nodes, save the following machine config sample to a file in the <installation_directory>/openshift directory. For example, name the file 99-openshift-master-tang-encryption.yaml:

      1. apiVersion: machineconfiguration.openshift.io/v1
      2. kind: MachineConfig
      3. metadata:
      4. name: master-tang
      5. labels:
      6. machineconfiguration.openshift.io/role: master
      7. spec:
      8. config:
      9. ignition:
      10. version: 3.2.0
      11. storage:
      12. luks:
      13. - name: root
      14. device: /dev/disk/by-partlabel/root
      15. clevis:
      16. tang:
      17. - url: http://tang.example.com:7500 (1)
      18. thumbprint: PLjNyRdGw03zlRoGjQYMahSZGu9 (2)
      19. options: [--cipher, aes-cbc-essiv:sha256]
      20. wipeVolume: true
      21. filesystems:
      22. - device: /dev/mapper/root
      23. format: xfs
      24. wipeFilesystem: true
      25. label: root
      26. kernelArguments:
      27. - rd.neednet=1 (3)
      1Specify the URL of a Tang server. In this example, tangd.socket is listening on port 7500 on the Tang server.
      2Specify the exchange key thumbprint, which was generated in a preceding step.
      3Add the rd.neednet=1 kernel argument to bring the network up in the initramfs. This argument is required.
    • To configure encryption on the compute nodes, save the following machine config sample to a file in the <installation_directory>/openshift directory. For example, name the file 99-openshift-worker-tang-encryption.yaml:

      1. apiVersion: machineconfiguration.openshift.io/v1
      2. kind: MachineConfig
      3. metadata:
      4. name: worker-tang
      5. labels:
      6. machineconfiguration.openshift.io/role: worker
      7. spec:
      8. config:
      9. ignition:
      10. version: 3.2.0
      11. storage:
      12. luks:
      13. - name: root
      14. device: /dev/disk/by-partlabel/root
      15. clevis:
      16. tang:
      17. - url: http://tang.example.com:7500 (1)
      18. thumbprint: PLjNyRdGw03zlRoGjQYMahSZGu9 (2)
      19. options: [--cipher, aes-cbc-essiv:sha256]
      20. wipeVolume: true
      21. filesystems:
      22. - device: /dev/mapper/root
      23. format: xfs
      24. wipeFilesystem: true
      25. label: root
      26. kernelArguments:
      27. - rd.neednet=1 (3)
      1Specify the URL of a Tang server. In this example, tangd.socket is listening on port 7500 on the Tang server.
      2Specify the exchange key thumbprint, which was generated in a preceding step.
      3Add the rd.neednet=1 kernel argument to bring the network up in the initramfs. This argument is required.
  7. Create a backup copy of the YAML files. The original YAML files are consumed when you create the Ignition config files.

  8. Continue with the remainder of the OKD installation.

If you configure additional data partitions, they will not be encrypted unless encryption is explicitly requested.

Mirroring disks during installation

During OKD installation on control plane and compute nodes, you can enable mirroring of the boot disk 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 Fedora CoreOS (FCOS) systems. Mirroring support is available on x86_64 nodes booted with BIOS or UEFI and on ppc64le nodes.

Procedure

To enable boot disk mirroring during OKD deployment:

  1. Follow the bare metal install procedure up to the point where you created Ignition configs for your installation.

    For example, you should have entered the following command:

    1. $ openshift-install create ignition-configs --dir $HOME/clusterconfig
  2. Verify that the Ignition config files were created:

    1. $ ls $HOME/clusterconfig/

    Example output

    1. auth bootstrap.ign master.ign metadata.json worker.ign
  3. Create a FCOS Config (RCC) with a reference to your master.ign or worker.ign config, depending on the type of node you are configuring. The RCC must specify the devices to be used for boot disk mirroring. If you want LUKS encryption on the mirrored root filesystem, you must configure it in this RCC.

    The following RCC example demonstrates how to create $HOME/clusterconfig/worker-raid.rcc:

    RCC example

    1. variant: rhcos
    2. version: 0.1.0
    3. ignition:
    4. config:
    5. merge:
    6. - local: worker.ign (1)
    7. boot_device:
    8. mirror:
    9. devices: (2)
    10. - /dev/sda
    11. - /dev/sdb
    12. luks: (3)
    13. tpm2: true (4)
    14. tang: (5)
    15. - url: http://tang.example.com:7500
    16. thumbprint: <tang_thumbprint>
    17. storage: (6)
    18. luks:
    19. - name: root
    20. options: [--cipher, aes-cbc-essiv:sha256]
    1Use the name of the Ignition config for your node type.
    2List all disk devices that should be included in the boot disk mirror, including the disk that FCOS will be installed onto.
    3Include this section if you want to encrypt the root filesystem. See “Encrypting disks during installation” for more details.
    4Include this field if you want to use a Trusted Platform Module (TPM) to encrypt the root filesystem. See “Enabling TPM v2 disk encryption” for more details.
    5Include this section if you want to use a Tang server. To obtain the server URL and thumbprint, follow the instructions in “Enabling Tang disk encryption”.
    6Include this section if you want to encrypt the root filesystem.
  4. Run the Fedora CoreOS Config Transpiler (FCCT) tool to merge your RCC, such as worker-raid.rcc, with the Ignition config specified in the RCC that you created in the previous step:

    1. $ podman run --pull=always --rm --volume $HOME/clusterconfig:/pwd --workdir /pwd \
    2. quay.io/coreos/fcct:release --files-dir . worker-raid.rcc --output worker-raid.ign

    This command produces a combined Ignition config in $HOME/clusterconfig/worker-raid.ign.

  5. Continue with the remainder of the OKD deployment, using the combined Ignition config to provision nodes.

Configuring chrony time service

You can set the time server and related settings used by the chrony time service (chronyd) by modifying the contents of the chrony.conf file and passing those contents to your nodes as a machine config.

Procedure

  1. Create the contents of the chrony.conf file and encode it as base64. For example:

    1. $ cat << EOF | base64
    2. pool 0.rhel.pool.ntp.org iburst (1)
    3. driftfile /var/lib/chrony/drift
    4. makestep 1.0 3
    5. rtcsync
    6. logdir /var/log/chrony
    7. EOF
    1Specify 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, or 3.rhel.pool.ntp.org.

    Example output

    1. ICAgIHNlcnZlciBjbG9jay5yZWRoYXQuY29tIGlidXJzdAogICAgZHJpZnRmaWxlIC92YXIvbGli
    2. L2Nocm9ueS9kcmlmdAogICAgbWFrZXN0ZXAgMS4wIDMKICAgIHJ0Y3N5bmMKICAgIGxvZ2RpciAv
    3. dmFyL2xvZy9jaHJvbnkK
  2. Create the MachineConfig object file, replacing the base64 string with the one you just created. This example adds the file to master nodes. You can change it to worker or make an additional MachineConfig for the worker role. Create MachineConfig files for each type of machine that your cluster uses:

    1. $ cat << EOF > ./99-masters-chrony-configuration.yaml
    2. apiVersion: machineconfiguration.openshift.io/v1
    3. kind: MachineConfig
    4. metadata:
    5. labels:
    6. machineconfiguration.openshift.io/role: master
    7. name: 99-masters-chrony-configuration
    8. spec:
    9. config:
    10. ignition:
    11. config: {}
    12. security:
    13. tls: {}
    14. timeouts: {}
    15. version: 3.2.0
    16. networkd: {}
    17. passwd: {}
    18. storage:
    19. files:
    20. - contents:
    21. source: data:text/plain;charset=utf-8;base64,ICAgIHNlcnZlciBjbG9jay5yZWRoYXQuY29tIGlidXJzdAogICAgZHJpZnRmaWxlIC92YXIvbGliL2Nocm9ueS9kcmlmdAogICAgbWFrZXN0ZXAgMS4wIDMKICAgIHJ0Y3N5bmMKICAgIGxvZ2RpciAvdmFyL2xvZy9jaHJvbnkK
    22. mode: 420
    23. overwrite: true
    24. path: /etc/chrony.conf
    25. osImageURL: ""
    26. EOF
  3. Make a backup copy of the configuration files.

  4. Apply the configurations in one of two ways:

    • If the cluster is not up yet, after you generate manifest files, add this file to the <installation_directory>/openshift directory, and then continue to create the cluster.

    • If the cluster is already running, apply the file:

      1. $ oc apply -f ./99-masters-chrony-configuration.yaml