Skip to content

Instantly share code, notes, and snippets.

@acsulli
Created January 18, 2022 22:33
Show Gist options
  • Save acsulli/ac2b46332cbee43da69d18456b9af700 to your computer and use it in GitHub Desktop.
Save acsulli/ac2b46332cbee43da69d18456b9af700 to your computer and use it in GitHub Desktop.

This gist provides some additional information referenced in the Ask an OpenShift Admin livestream on January 12th, 2022.

Updating OpenShift Clusters

Triggering an update to the cluster is done the same way, whether you're doing an update between z-streams (e.g. 4.9.8 -> 4.9.13) or an upgrade between y-releases (e.g. 4.8.z -> 4.9.z). There are three primary options:

  1. Use the webconsole This is pretty straightforward, browse to the Administration panel, then click the update button. If you're upgrading between y-releases, you may need to change the release stream.

  2. Use the CLI If you need to update the channel, you'll need to oc patch the clusterversion object:

    oc patch clusterversion version --type merge -p '{"spec": {"channel": "stable-4.8"}}'

    Once that's done, trigger the update via the oc adm upgrade command:

    # update to the latest version available in the channel
    oc adm upgrade --to-latest=true
    
    # update to a specific version
    oc adm upgrade --to=$version
    
    # update to a specific release image
    oc adm release info quay.io/openshift-release-dev/ocp-release:4.9.12-x86_64
    oc adm upgrade --allow-explicit-upgrade --to-image $IMAGE
  3. Use a YAML file This is particularly helpful if you're using GitOps to manage your cluster.

    apiVersion: config.openshift.io/v1
    kind: ClusterVersion
    metadata:
      name: version
    spec:
      channel: stable-4.9
      clusterID: <id>
      desiredUpdate:
          version: 4.9.12

    You can change both the channel and the specific release using this method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment