Upgrading the IBM Engineering AI Hub operator by using command line inputs

You can upgrade IBM Engineering AI Hub operator by switching to the appropriate channel. The IBM Engineering AI Hub operator upgrade process depends on the approval strategy that was selected during the IBM Engineering AI Hub operator installation. Upgrading the IBM Engineering AI Hub operator by using command line inputs includes upgrading the operator by Red Hat OpenShift or Kubernetes commands.

Before you begin

  1. Ensure that the existing IBM Engineering AI Hub setup is functional without any errors and all IBM Engineering AI Hub applications are accessible.
  2. Ensure that you have the appropriate permissions to upgrade the IBM Engineering AI Hub operator.
  3. Verify that the 1.2 channel is available for upgrade, where 1.2 identifies the IBM Engineering AI Hub operator, engineering-elmaihub-operator version that you want to upgrade to.
    1. Log in to the cluster by using the command line.
    2. Look up for the available versions and channels of the engineeing-aihub-operator that you want to install by running the following command:

      Red Hat OpenShift container platform
      oc describe packagemanifests <operator_name> -n <catalog_namespace>

      where <operator_name> is engineering-aihub-operator.

      Kubernetes cluster
      kubectl describe packagemanifests <operator_name> -n <catalog_namespace>

      where <operator_name> is engineering-aihub-operator.

  4. Upgrade the IBM Engineering AI Hub instance to the latest available version.
    Note: Upgrading the operator depends on your approval strategy and channel strategy. If your strategy is “Automatic”, operator versions available on the same channel are installed automatically.

About this task

Upgrading between the major release versions of IBM Engineering AI Hub requires a change of operator channel, which is always a manual action for the user.

Procedure

  1. Log in to the Red Hat OpenShift container platform or Kubernetes cluster by running the following commands.
    Red Hat OpenShift container platform
    oc login --username=<cluster admin user> --password=<cluster admin password>
    Kubernetes cluster
    kubectl login --username=<cluster admin user> --password=<cluster admin password>
  2. Set the default project or namespace as the one that contains the operator to be upgraded.
    Red Hat OpenShift container platform
    oc project <namespace>
    Kubernetes cluster
    kubectl config set-context --current --namespace=<namespace>
  3. Get a list of all the subscriptions in this project or namespace.
    Red Hat OpenShift container platform
    oc get subscriptions
    Kubernetes cluster
    kubectl get subscriptions
    This returns the list of subscriptions in the namespace.
    Name Package Source Channel
    engineering-aihub-operator engineering-aihub-operator ibm-elmaihub-manifests 1.1

    For the information that is returned, identify the subscription name for the operator that you want to upgrade from the NAME column, and the corresponding package name from the PACKAGE column.

  4. For the subscription with an automatic approval strategy, complete the following steps:
    1. Verify that the channel to which you want to upgrade is available.
    2. Replace <package-name> in the following command by using the information returned in the previous step:
    Red Hat OpenShift container platform
    oc get packagemanifest <package-name> -o jsonpath='{.status.channels[*].name}'
    Kubernetes cluster
    kubectl get packagemanifest <package-name> -o jsonpath='{.status.channels[*].name}'
  5. For the subscription with a manual approval strategy, complete the following steps. Replace the <subscription-name> in the following commands by using the information in Step 3.
    1. Run the following command to check if your subscription is pending.
      Red Hat OpenShift container platform
      oc get subscription <subscription-name> -o yaml
      Kubernetes cluster
      kubectl get subscription <subscription-name> -o yaml
    2. Preview the installation plan by using the following command. The manual installation plan details are shown.
      Red Hat OpenShift container platform
      oc get installplan -n <namespace>
      Kubernetes cluster
      kubectl get installplan -n <namespace>
    3. Verify if the state of the subscription is pending.
      state: UpgradePending
    4. Approve the upgrade by using the following command.
      Red Hat OpenShift container platform
      oc patch installplan <installplan-name> --type merge -p '{"spec":{"approved":true}}'
      Kubernetes cluster
      kubectl patch installplan <installplan-name> --type merge -p '{"spec":{"approved":true}}'
  6. Optional: Patch the subscription to move to the desired upgrade channel, replacing <subscription-name> and <channel> in the following commands.
    Red Hat OpenShift container platform
    oc patch subscription <subcription-name> --patch '{"spec":{"channel":"<channel>"}}' --type=merge
    Kubernetes cluster
    kubectl patch subscription <subcription-name> --patch '{"spec":{"channel":"<channel>"}}' --type=merge
  7. To confirm whether the upgrade is successful, run the following command and check that the channel is correct.
    Red Hat OpenShift container platform
    oc get subscriptions
    Kubernetes cluster
    kubectl get subscriptions

What to do next

You can upgrade the instances after the operators that are used are upgraded.