4.6. Updating RHEL compute machines in your cluster

After you update your cluster, you must update the Red Hat Enterprise Linux (RHEL) compute machines in your cluster.

Prerequisites

  • You updated your cluster.

    重要

    Because the RHEL machines require assets that are generated by the cluster to complete the update process, you must update the cluster before you update the RHEL compute machines in it.

  • You have access to the machine that you used to add the RHEL compute machines cluster. You must have access to the hosts Ansible inventory file that defines your RHEL machines and the upgrade playbook.

Procedure

  1. Stop and disable firewalld on the host:

    # systemctl disable --now firewalld.service
    注意

    You must not enable firewalld later. If you do, you cannot access OpenShift Container Platform logs on the worker.

  2. Enable the repositories that are required for OpenShift Container Platform 4.5:

    1. On the machine that you run the Ansible playbooks, update the required repositories:

      # subscription-manager repos --disable=rhel-7-server-ose-4.4-rpms \
                                   --enable=rhel-7-server-ansible-2.9-rpms \
                                   --enable=rhel-7-server-ose-4.5-rpms
    2. On the machine that you run the Ansible playbooks, update the required packages, including openshift-ansible:

      # yum update openshift-ansible openshift-clients
    3. On each RHEL compute node, update the required repositories:

      # subscription-manager repos --disable=rhel-7-server-ose-4.4-rpms \
                                   --enable=rhel-7-server-ose-4.5-rpms
  3. Update a RHEL worker machine:

    1. Review the current node status to determine which RHEL worker to update:

      # oc get node

      Example output

      NAME                        STATUS                        ROLES    AGE    VERSION
      mycluster-control-plane-0   Ready                         master   145m   v1.18.3
      mycluster-control-plane-1   Ready                         master   145m   v1.18.3
      mycluster-control-plane-2   Ready                         master   145m   v1.18.3
      mycluster-rhel7-0           NotReady,SchedulingDisabled   worker   98m    v1.14.6+97c81d00e
      mycluster-rhel7-1           Ready                         worker   98m    v1.14.6+97c81d00e
      mycluster-rhel7-2           Ready                         worker   98m    v1.14.6+97c81d00e
      mycluster-rhel7-3           Ready                         worker   98m    v1.14.6+97c81d00e

      Note which machine has the NotReady,SchedulingDisabled status.

    2. Review your Ansible inventory file at /<path>/inventory/hosts and update its contents so that only the machine with the NotReady,SchedulingDisabled status is listed in the [workers] section, as shown in the following example:

      [all:vars]
      ansible_user=root
      #ansible_become=True
      
      openshift_kubeconfig_path="~/.kube/config"
      
      [workers]
      mycluster-rhel7-0.example.com
    3. Change to the openshift-ansible directory:

      $ cd /usr/share/ansible/openshift-ansible
    4. Run the upgrade playbook:

      $ ansible-playbook -i /<path>/inventory/hosts playbooks/upgrade.yml 1
      1
      For <path>, specify the path to the Ansible inventory file that you created.
  4. Follow the process in the previous step to update each RHEL worker machine in your cluster.
  5. After you update all of the workers, confirm that all of your cluster nodes have updated to the new version:

    # oc get node

    Example output

    NAME                        STATUS                        ROLES    AGE    VERSION
    mycluster-control-plane-0   Ready                         master   145m   v1.18.3
    mycluster-control-plane-1   Ready                         master   145m   v1.18.3
    mycluster-control-plane-2   Ready                         master   145m   v1.18.3
    mycluster-rhel7-0           NotReady,SchedulingDisabled   worker   98m    v1.18.3
    mycluster-rhel7-1           Ready                         worker   98m    v1.18.3
    mycluster-rhel7-2           Ready                         worker   98m    v1.18.3
    mycluster-rhel7-3           Ready                         worker   98m    v1.18.3