Upgrading the Db2 Operator from the command line

The IBM Cloud Pak command line interface (ibm-pak) provides significant benefits when dealing with air-gapped (disconnected) environments for case management. You can use the ibm-pak CLI to upgrade your Db2 Operator to the latest version or CN level.

Before you begin

Ensure that you install the ibm-pak tool before proceeding.

Procedure

  1. Download and extract the Container Application Software for Enterprises (CASE) bundle:
    1. Set up environment variables.

      Review the following parameters for your environment and then run the following commands to set up the environment:

      export CASE_NAME=ibm-db2uoperator
      export CASE_VERSION=<CASE version of latest Db2 Operator>
    2. Download the CASE bundle:
      $ oc ibm-pak get ${CASE_NAME} --version ${CASE_VERSION}
      Downloading and extracting the CASE ...
      - Success
      Retrieving CASE version ...
      - Success
      Validating the CASE ...
      Validating the signature for the ibm-db2uoperator CASE...
      - Success
      Creating inventory ...
      - Success
      Finding inventory items
      - Success
      Resolving inventory items ...
      Parsing inventory items
      - Success
  2. Install the Db2 catalog:
    oc ibm-pak launch ${CASE_NAME}         \
        --version ${CASE_VERSION}          \
        --namespace openshift-marketplace  \
        --inventory db2uOperatorSetup      \
        --action installCatalog
  3. Install the Db2 operator:
    export NAMESPACE=<Name of the namespace>
    oc ibm-pak launch ${CASE_NAME}                \
        --version ${CASE_VERSION}                 \
        --namespace ${NAMESPACE}                  \
        --inventory db2uOperatorStandaloneSetup   \
        --action installOperator
  4. Verify the installation:
    oc get CatalogSources ibm-db2uoperator-catalog -n openshift-marketplace
    When the catalog source is updated, the Db2 Operator is automatically upgraded if the installPlanApproval property is set to Automatic in your Db2 Operator subscription.
    Check the setting of the installPlanApproval property in your Db2 Operator subscription:
     $ oc get subscription ibm-db2uoperator-catalog-subscription -oyaml | grep installPlanApproval
    Note: The Db2 Operator installPlanApproval property is set to Automatic by default.
    If the installPlanApproval is not set to Automatic, upgrade the Db2 Operator by manually approving the upgrades. You can find the steps to manually approve the upgrades in the CustomResourceDefinitions > Subscription page of the Operator Lifecycle Manager site, or from the Operator Details page of the Db2 Operator on the OpenShift® web console.