Updating the WebSphere Liberty operator

You can update WebSphere Liberty operator. Instructions are provided for both network-connected installations and installations in air gap environments.

Updating a network-connected installation on Red Hat OpenShift

To update a network-connected installation,
  1. Update the update channel for the WebSphere Liberty operator to v1.3. For more information, see Changing the update channel for an Operator in the Red Hat® OpenShift® documentation. For patch updates, if the operator was configured with the Automatic update approval strategy, no action is needed. The WebSphere Liberty operator automatically upgrades your installation.

    If the operator was configured with the Manual update strategy, follow the instructions for Manually approving a pending operator upgrade.

Updating an installation in an air gap environment

To update an installation of WebSphere Liberty operator in an air gap environment, follow these instructions.

  1. Mirror the WebSphere Liberty operator container images and configure a cluster.
    1. Download Container Application Software for Enterprises (CASE).

      Run the following command to download the CASE metadata.

      oc ibm-pak get $CASE_NAME --version $CASE_VERSION
      
      For the current release of WebSphere Liberty operator,
    2. Verify that you downloaded the correct version.
      oc ibm-pak list --downloaded
    3. Generate the mirror manifests, substituting the actual target registry.
      export TARGET_REGISTRY=my_example_registry.com
      oc ibm-pak generate mirror-manifests $CASE_NAME $TARGET_REGISTRY --version $CASE_VERSION
    4. Authenticate to all registries by following the instructions for using either podman or docker. Set the REGISTRY_AUTH_FILE environment variable appropriately.
    5. Mirror the images.
      oc image mirror \
       -f ~/.ibm-pak/data/mirror/$CASE_NAME/$CASE_VERSION/images-mapping.txt \
       --filter-by-os '.*'  \
       -a $REGISTRY_AUTH_FILE \
       --insecure  \
       --skip-multiple-scopes \
       --max-per-registry=1
    6. Configure the cluster for insecure registry. Replace TARGET_REGISTRY with the name of your registry and then run the oc patch command.
      oc patch image.config.openshift.io/cluster --type=merge \
      -p '{"spec":{"registrySources":{"insecureRegistries":["'${TARGET_REGISTRY}'"]}}}'
    7. Update the global image pull secret for your Red Hat OpenShift cluster. Follow the instructions in Updating the global cluster pull secret.
    8. Create the ImageContentSourcePolicy resource.
      oc apply -f  ~/.ibm-pak/data/mirror/$CASE_NAME/$CASE_VERSION/image-content-source-policy.yaml
      Tip: Deployment of the ImageContentSourcePolicy resource takes several minutes while each node is drained of its pods. Before you move to the next step, ensure that the status of all nodes is Ready. Run the oc get nodes command to get status.
    9. Wait for rollout process to finish.

      Run the following command to verify that Updated is set to true.

      oc get MachineConfigPool -w
  2. Install the WebSphere Liberty operator.
    1. Set the WLO_NAMESPACE and WLO_TARGET_NAMESPACE shell variables.

      For the AllNamespaces installation mode, set WLO_NAMESPACE to openshift-operators. Set WLO_TARGET_NAMESPACE to the instance namespace, for example, websphere-liberty. For a SingleNamespace installation mode, use different namespace values. For an OwnNamespace mode, set WLO_NAMESPACE to the same value as WLO_TARGET_NAMESPACE.

      WLO_NAMESPACE=openshift-operators
      WLO_TARGET_NAMESPACE=websphere-liberty
    2. Create the namespaces, if needed.

      For catalog namespace, openshift-marketplace exists. For an AllNamespaces installation mode, the openshift-operators namespace exists.

      oc create namespace $WLO_NAMESPACE
      oc create namespace $WLO_TARGET_NAMESPACE
    3. For either an OwnNamespace or SingleNamespace installation mode, create an OperatorGroup.
      Note: For the default AllNamespaces mode, skip this step.
      cat <<EOF | oc apply -f -
      apiVersion: operators.coreos.com/v1alpha2
      kind: OperatorGroup
      metadata:
        name: ibm-websphere-liberty
        namespace: $WLO_NAMESPACE
      spec:
        targetNamespaces:
        - $WLO_TARGET_NAMESPACE
      EOF
    4. Install operator catalog for WebSphere Liberty operator and its dependencies.
      export NAMESPACE=openshift-marketplace
      export CASE_INVENTORY_SETUP=websphereLibertyOperatorSetup
      oc ibm-pak launch \
      $CASE_NAME \
        --version $CASE_VERSION \
        --action install-catalog \
        --inventory $CASE_INVENTORY_SETUP \
        --namespace $NAMESPACE \
        --args "--registry $TARGET_REGISTRY --recursive \
        --inputDir ~/.ibm-pak/data/cases/$CASE_NAME/$CASE_VERSION"
      
  3. Update the update channel for the WebSphere Liberty operator to v1.3. For more information, see Changing the update channel for an Operator in the Red Hat OpenShift documentation. For patch updates, if the operator was configured with the Automatic update approval strategy, no action is needed. The WebSphere Liberty operator automatically upgrades your installation.

    If the operator was configured with the Manual update strategy, follow the instructions for Manually approving a pending operator upgrade.

Updating in a non-OCP Kubernetes environment

To update the WebSphere Liberty operator in a non-OCP Kubernetes environment, follow the instructions in Installing WebSphere Liberty operator with the Kubernetes CLI.

What to do next

Validate the installation.