Installing IBM Cloud Transformation Advisor in a Disconnected/Air-gapped Environment

If your cluster is not connected to the internet, you can install IBM Cloud Transformation Advisor in your cluster by using the ibm-pak-plugin and the CASE package.

NOTE: As of Transformation Advisor 3.3.0, it is recommended to use the ibm-pak-plugin tool as described here to perform the disconnected installation. The ibm-pak-plugin replaces the use of the cloudctl CLI tool that was used to perform the install in previous versions.

Overview

IMPORTANT: Please read the Cluster Administration Tasks section in the installation instructions before proceeding with the installation.

It is common in production to have a cluster that does not have internet access. This is often referred to as a disconnected, air-gapped or offline environment. This document describes how to install Transformation Advisor in such an environment using the ibm-pak-plugin and the CASE package.

About the CASE based installation

The Container Application Software for Enterprises (CASE) specification defines metadata and structure for packaging a containerized application. For more details please see CASE Specification.

The CASE installer provides the commands needed to install/uninstall Transformation Advisor using the CLI. The CASE install action will install both the operator and instance with a single command.

Installing using the CASE installer supports the same two install modes as installing using the OpenShift UI:

  • All namespaces on the cluster (default)

    Operator will be available in all Namespaces.

  • A specific namespace on the cluster (specify the --namespaceScoped true in the --args)

    Operator will be available in a single Namespace only.

For both installation modes, you are required to perform some steps as a cluster administrator as described in the Cluster Administration Tasks section in the installation instructions.

The Transformation Advisor CASE contains three inventory items:

  • v2InstallProduct - Provides the CASE actions to install/uninstall the Transformation Advisor product. It will first install the operator - optionally installing catalogs as required - and then install the instance.
  • v2TransAdvOperator - Provides the CASE actions to install/uninstall the Transformation Advisor operator.
  • v2TransAdv - Provides the CASE actions to install/uninstall the Transformation Advisor instance.

Each inventory has a README.md with details on the install actions and options available in that inventory.

About the ibm-pak-plugin

The ibm-pak-plugin is a plugin for the oc CLI tool that streamlines the deployment of IBM CloudPaks in a disconnected environment which was done earlier using [cloudctl] (https://github.com/IBM/cloud-pak-cli).

Please read carefully the ibm-pak-plugin documentation.

Installation Procedure

Catalog-based image mirroring

Starting with ibm-pak v1.8.0, the plug-in lays the foundation for eventual support for catalog-based mirroring. Information about catalog-based mirroring is described in the doc. At this time, catalog-based mirroring and oc-mirror tool usage is a Tech Preview feature, which may not be supported by all products. Transformation Advisor is enabled for catalog based mirroring starting from version 3.8.0. oc mirror tool usage is enabled in Transformation Advisor as a Tech Preview. The recommended install path continues to leverage oc image mirror as described in the steps here.

A consequence of enabling catalog based mirroring in Transformation Advisor is that the images-mapping.txt file generated by oc ibm-pak generate mirror-manifests ... command now contains all the versions necessary to install Transformation or to upgrade from any allowed upgrade path.

KNOWN ISSUE: In Transformation Advisor 3.8.0 and 3.8.1 there is a known issue whereby more images than are necessary are populated in the ~/.ibm-pak/data/mirror/ibm-transadv/VERSION/images-mapping.txt after running oc ibm-pak generate mirror-manifests .... Additionally, some of the image references are incorrect and cause the subsequent oc image mirror ... command to fail. You can manually edit the ~/.ibm-pak/data/mirror/ibm-transadv/VERSION/images-mapping.txt file before running oc image mirror ... to remove unwanted images. See following note on removing all but current version images.

If installing Transformation Advisor for the first time, or if upgrading from Version 3.0.1+, you can use the following command to reduce the number of images to mirror (Note: you must have already run the oc ibm-pak generate mirror-manifests ... command):

Replace MAJOR, MINOR and PATCH, with the MAJOR, MINOR and PATCH numbers that correspond to the version of Transformation Advisor that you are installing.

cd ~/.ibm-pak/data/mirror/ibm-transadv/MAJOR.MINOR.PATCH/
mv images-mapping.txt images-mapping.txt.orig; grep ":MAJOR\.MINOR\.PATCH" images-mapping.txt.orig > images-mapping.txt; grep ":vMAJOR\.MINOR" images-mapping.txt.orig >> images-mapping.txt

Steps

  1. Download the ibm-pak plugin, and oc tools. Downloading the tools is described in the ibm-pak documentation.
  2. Configure the ibm-pak plugin to point to the CASE repository. You can choose to point to the IBM GitHub repo (https://github.com/IBM/cloud-pak/raw/master/repo/case/) OR (as of ibm-pak version 1.2.0) to the IBM Cloud Container Registry and download the CASE as OCI artifacts.
   oc ibm-pak config repo 'IBM Cloud-Pak Github Production Repo' --url https://github.com/IBM/cloud-pak/raw/master/repo/case/ --enable

OR

oc ibm-pak config repo 'IBM Cloud-Pak OCI registry' -r oci:cp.icr.io/cpopen --enable
  1. Choose one of the supported paths for the disconnected installation. The IBM Cloud Pak documentation describes the two supported paths: Bastion host and Filesystem.
  2. Download the Transformation Advisor CASE - substituting the desired version:
export CASE_NAME=ibm-transadv
export CASE_VERSION=X.Y.Z
oc ibm-pak get $CASE_NAME --version $CASE_VERSION
  1. Verify you have downloaded the correct version:
oc ibm-pak list --downloaded
  1. Generate the mirror manifests - substituting the actual target registry:

    1. For Bastion host path:
      export TARGET_REGISTRY=mytargetregistry.com
      oc ibm-pak generate mirror-manifests $CASE_NAME $TARGET_REGISTRY --version $CASE_VERSION
      
    2. For Filesystem path:
      export TARGET_REGISTRY=mytargetregistry.com
      oc ibm-pak generate mirror-manifests \
       $CASE_NAME \
       file://local \
       --version $CASE_VERSION \
       --final-registry $TARGET_REGISTRY
      
  2. Authenticate to all registries. Follow the instructions here to authenticate to all registries using either podman or docker. Set the REGISTRY_AUTH_FILE environment variable appropriately.

  3. (Bastion) Mirror images - Bastion host path:

    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
    

    8 (Filesystem). Mirror images - Filesystem path:

    1. Download images to file system:
      oc image mirror \
       -f ~/.ibm-pak/data/mirror/$CASE_NAME/$CASE_VERSION/images-mapping-to-filesystem.txt \
       --filter-by-os '.*' \
       -a $REGISTRY_AUTH_FILE \
       --insecure \
       --skip-multiple-scopes \
       --max-per-registry=1
      
    2. Move the generated items to a machine inside the firewall which has access to the TARGET_REGISTRY. The items to move are:
      1. v2 directory
      2. The auth file referred by $REGISTSRY_AUTH_FILE
      3. ~/.ibm-pak/data/mirror/$CASE_NAME/$CASE_VERSION/images-mapping-from-filesystem.txt
    3. Move images to final destination:
      oc image mirror \
       -f ~/.ibm-pak/data/mirror/$CASE_NAME/$CASE_VERSION/images-mapping-from-filesystem.txt \
       -a $REGISTRY_AUTH_FILE \
       --from-dir=${v2_dir} \
       --filter-by-os '.*' \
       --insecure \
       --skip-multiple-scopes \
       --max-per-registry=1
      
      ${v2_dir} refers to the parent directory on the file system where the v2 directory was copied to.
  4. [Optional] Configure cluster for insecure registry

    • If your TARGET_REGISTRY is insecure, you must add it to the cluster insecureRegistries list.
      oc patch image.config.openshift.io/cluster --type=merge \
      -p '{"spec":{"registrySources":{"insecureRegistries":["'${TARGET_REGISTRY}'"]}}}'
      
  5. Update the global image pull secret for your Red Hat OpenShift cluster. Add in the secret to allow your cluster to pull from your mirror registry - if you have not already set that up. Follow the steps in Updating the global cluster pull secret.

  6. Create ImageContentSourcePolicy

    oc apply -f  ~/.ibm-pak/data/mirror/$CASE_NAME/$CASE_VERSION/image-content-source-policy.yaml
    

    Wait until all nodes are ready. You can monitor the nodes with the following command:

    oc get nodes -w
    

    Alternatively, monitor the MachineConfigPool - and ensure the the UPDATED column read True for the relevant worker pool:

    oc get MachineConfigPool -w
    
  7. Install Transformation Advisor

    • The following command will perform a full installation of Transformation Advisor. It will first install the private catalog, then the Transformation Advisor operator, and finally the instance. Substitute your desired namespace, a valid license type and set other options as required.
    export NAMESPACE=my_ta_namespace
    oc ibm-pak launch \
     $CASE_NAME \
     --version $CASE_VERSION \
     --action install \
     --inventory v2InstallProduct \
     --namespace $NAMESPACE \
     --args "--acceptLicense true --licenseType X-XXXX-XXXXXX --installTaCatalog --persistence true --storageClass ibmc-block-gold" 
    

    See install options for more details on the options accepted by Transformation Advisor.

Transformation Advisor installation options

The following options can be provided in the --args parameter to customize the installation.

  • View the full set of options: --taHelp
  • View the different license options available: --viewLicense
  • Install the Transformation Advisor private catalog if it doesn't already exist. Required for disconnected install: --installTaCatalog
  • Turn persistence on and set the storage class: --persistence true --storageClass ibmc-block-gold

For a full list of options see Configuring Transformation Advisor.

Accessing the UI

At the end of a successful install, you will be presented with a link in the console that will take you to the Transformation Advisor UI. Alternatively, you can navigate to the Transformatino Advisor route in the OpenShift UI by going to Networking - Routes and click the location of the ui-route. You will need to have a valid login to the cluster to access Transformation Advisor UI.

Validating a successful installation

To validate the installation, using either the OpenShift UI or the oc CLI tool to check the Transformation Advisor pods. You should see the following fours pods in a READY and Running state:

ta-couchdb-0
ta-neo4j-0
ta-server-<ID>
ta-ui-<ID>

Additionally, you should see the instance pre-install job in a "Completed" state:

ta-operator-instance-preinstall-<ID>

If you have performed a single namespace install, then you will also see the operator pod in a READY and Running state:

ibm-transformation-advisor-manager-<ID>

Navigate to the Transformation Advisor UI as described here. Click on the kebab icon on the top right of the Transformation Advisor UI and then click on "What's New". Confirm the Transformation Advisor version in the What's New dialog.

Uninstalling with ibm-pak-plugin

IMPORTANT: If the CASE installation fails for any reason (if for example you set an install argument incorrectly like the user or password) and you want to retry the installation, first uninstall using the CASE uninstall command that is shown below. Do not manually delete the target namespace before you have run the uninstall command.

Run the following command to uninstall:

oc ibm-pak launch \
 $CASE_NAME \
 --version $CASE_VERSION \
 --action uninstall \
 --inventory v2InstallProduct \
 --namespace $NAMESPACE

Upgrading in an disconnected environment

Note: It is not possible to upgrade from Transformation Advisor 2.5.x to 3.0.x. You must uninstall 2.5.x before then installing 3.0.x. Please read Moving from 2.5.x to 3.0.x and data migration for more details.

To perform an upgrade in an disconnected/air-gapped environment, perform the steps described above to mirror the Transformation Advisor images for the latest release to your mirror registry. After that is completed, update the Transformation Advisor catalog to the latest version with the following command:

oc ibm-pak launch \
 $CASE_NAME \
 --version $CASE_VERSION \
 --action install-catalog \
 --inventory v2TransAdvOperator \
 --namespace $NAMESPACE

After the catalog is updated, the Transformation Advisor operator will become ready for upgrade. This might take some time and depends on the Registry Poll Interval for the catalog. By default that is set to 45 minutes.

If automatic upgrade is available for the release, Transformation Advisor will automatically upgrade. If you have disabled automatic upgrades, you must accept the upgrade in the OpenShift UI. Otherwise, you might need to subscribe to a new channel to receive the upgrade. For release specific instructions for upgrading please see upgrading.

TODO: If you are installing the evaluation images it is necessary to update the image locations to point to the registry icr.io/appcafe instead of the entitled registry. This step is completed as follows: If you are installing the evaluation images it is necessary to rename the ImageContentSourcePolicy. This step is completed as follows: oc get imagecontentsourcepolicy ibm-transadv -o yaml > saved_icsp.yaml; oc delete imagecontentsourcepolicy ibm-transadv; sed "s/ibm-transadv/ibm-eval-transadv/g" saved_icsp.yaml | oc apply -f - ; rm -f saved_icsp.yaml ```

.