Upgrading the Hosted Cluster

There is currently a known issue which prevents HCP cluster upgrades from the UI. The UI section of this lab has been disabled and will be brought back when the issue is fixed.

Upgrading the Hosted Cluster from the CLI

In this section we will see how we can run the update from the CLI.

Upgrading the Hosted Cluster Control Plane from the CLI

  1. Let’s get the hosted cluster updated from 4.18.4 to 4.18.8. We start with the Control Plane.

    oc --kubeconfig ~/hypershift-lab/mgmt-kubeconfig -n hosted patch hostedcluster hosted \
        -p '{"spec":{"release":{"image":"quay.io/openshift-release-dev/ocp-release:4.18.8-x86_64"}}}' \
        --type merge
    hostedcluster.hypershift.openshift.io/hosted patched
  2. The Control Plane will start its update, we can check the update process on the hosted cluster by checking the cluster operators.

    It may take up to ten minutes for the hosted cluster to start the update process.
    oc --insecure-skip-tls-verify=true --kubeconfig ~/hypershift-lab/hosted-kubeconfig \
        get clusteroperators
    NAME                                       VERSION   AVAILABLE   PROGRESSING   DEGRADED   SINCE   MESSAGE
    console                                    4.18.7    True        False         False      59s
    csi-snapshot-controller                    4.18.7    True        False         False      143m
    dns                                        4.18.7    True        True          False      160m    DNS "default" reports Progressing=True: "Have 1 available DNS pods, want 2.\nHave 1 up-to-date DNS pods, want 2.\nHave 1 available node-resolver pods, want 2."...
    image-registry                             4.18.8    True        False         False      18m
    <OMITTED>
  3. Eventually, all cluster operators will be running 4.18.8 and the ClusterVersion will report that release.

    oc --insecure-skip-tls-verify=true --kubeconfig ~/hypershift-lab/hosted-kubeconfig \
        get clusterversion
    NAME      VERSION   AVAILABLE   PROGRESSING   SINCE   STATUS
    version   4.18.8    True        False         1s      Cluster version is 4.18.8

Upgrading the Hosted Cluster Data Plane from the CLI

  1. Now that the control plane is running 4.18.8, let’s move the nodes to 4.18.8.

    oc --kubeconfig ~/hypershift-lab/mgmt-kubeconfig -n hosted patch nodepool nodepool-hosted-1 \
        -p '{"spec":{"release":{"image":"quay.io/openshift-release-dev/ocp-release:4.18.8-x86_64"}}}' \
        --type merge
    nodepool.hypershift.openshift.io/nodepool-hosted-1 patched
  2. After a few minutes, nodes will start upgrading.

    oc --insecure-skip-tls-verify=true --kubeconfig ~/hypershift-lab/hosted-kubeconfig \
        get nodes -o wide
    NAME             STATUS                     ROLES    AGE     VERSION   INTERNAL-IP      EXTERNAL-IP   OS-IMAGE                                                KERNEL-VERSION                 CONTAINER-RUNTIME
    hosted-worker0   Ready,SchedulingDisabled   worker   5h14m   v1.31.6   192.168.125.30   <none>        Red Hat Enterprise Linux CoreOS 418.94.202503241359-0   5.14.0-427.62.1.el9_4.x86_64   cri-o://1.31.6-3.rhaos4.18.gitfd32f99.el9
    hosted-worker2   Ready                      worker   5h14m   v1.31.6   192.168.125.32   <none>        Red Hat Enterprise Linux CoreOS 418.94.202503241359-0   5.14.0-427.62.1.el9_4.x86_64   cri-o://1.31.6-3.rhaos4.18.gitfd32f99.el9
  3. Once completed, we can see both nodes are running a newer version (check the Node, RHCOS, Kernel and CRIO versions).

    oc --insecure-skip-tls-verify=true --kubeconfig ~/hypershift-lab/hosted-kubeconfig \
        get nodes -o wide
    NAME             STATUS   ROLES    AGE     VERSION   INTERNAL-IP      EXTERNAL-IP   OS-IMAGE                                                KERNEL-VERSION                 CONTAINER-RUNTIME
    hosted-worker0   Ready    worker   5h24m   v1.31.7   192.168.125.30   <none>        Red Hat Enterprise Linux CoreOS 418.94.202504021150-0   5.14.0-427.62.1.el9_4.x86_64   cri-o://1.31.7-2.rhaos4.18.git83d6749.el9
    hosted-worker2   Ready    worker   4h24m   v1.31.7   192.168.125.32   <none>        Red Hat Enterprise Linux CoreOS 418.94.202504021150-0   5.14.0-427.62.1.el9_4.x86_64   cri-o://1.31.7-2.rhaos4.18.git83d6749.el9
  4. The NodePool should report the correct version as well.

    oc --kubeconfig ~/hypershift-lab/mgmt-kubeconfig -n hosted get nodepool nodepool-hosted-1
    NAME                CLUSTER   DESIRED NODES   CURRENT NODES   AUTOSCALING   AUTOREPAIR   VERSION   UPDATINGVERSION   UPDATINGCONFIG   MESSAGE
    nodepool-hosted-1   hosted    2               2               False         False        4.18.8    False             False