Preparing images and resources for an air-gapped installation

Before you begin the air-gapped installation, you must prepare the images and resources. You must collect and transfer all container images and required plugins to your private registry or offline storage.

Before you begin

You must have completed following tasks:
  • Ensured that you have the administrative privileges on the target Kubernetes namespace and the airgap container registry.
  • Downloaded the DevOps Loop Helm chart and it is accessible.
  • Downloaded the airgap.sh script and ensured that it is available in the DevOps Loop Helm chart.
  • Allocated sufficient disk space to save product images and plugin files for transfer to the air-gapped environment.
    Note: Product images will consume approximately 50 GB or more of disk space in your internal/air-gapped image registry.

About this task

To copy the DevOps Loop product images from public repositories to your specified internal or air-gapped image registry, follow the steps below. The system where you run these steps must have access to both the internet and the internal or air-gapped registry.

As part of the DevOps Loop installation, additional components such as MongoDB (used to store application and configuration data) and the MySQL JDBC driver (required by the DevOps Deploy server) are also needed. In air-gapped environments, these components cannot be downloaded automatically and must be prepared manually. The steps below guide you through copying the DevOps Loop images as well as preparing MongoDB and the JDBC driver for installation.

Procedure

  1. Locate the airgap.sh script in the scripts/airgap folder of the downloaded DevOps Loop Helm chart.
  2. Run the following command to copy the DevOps Loop images into the internal/airgap image registry:
    sh ./ibm-devops-loop/scripts/airgap/airgap.sh -r
             ibm-devops-loop -d registry.local:5000/devops-loop
  3. Perform the following steps to prepare MongoDB for an air-gapped installation:
    Note: The DevOps Loop installation script deploys MongoDB in the same namespace as DevOps Loop. In an air-gapped environment, you must download the Helm chart locally and update the script, because it cannot fetch the chart from public repositories. The MongoDB server image is already available in your air-gapped registry.
    1. Download and extract the MongoDB Helm chart version 14.13.0 from Bitnami Helm Charts into the same directory as the expanded ibm-devops-loop Helm chart.
    2. Update the installation script to set MONGO_IMAGE_REPO=registry.local:5000/devops-loop and replace bitnami/mongodb with mongodb in the helm upgrade --install command.
  4. Perform the following steps to prepare the MySQL JDBC Driver for an air-gapped installation:
    Note: The DevOps Deploy server, installed as part of DevOps Loop, creates a MySQL database to store various artifacts. In an air-gapped environment, the installation cannot automatically download the required JDBC driver. You must make the drive available manually before starting the DevOps Loop installation. You can also refer to the the JDBC Driver section of the DevOps Deploy Prerequisites document. See the link provided in Related information.
    1. Download the required MySQL JDBC driver to a drive that is accessible in an air-gapped environment.
    2. Write a bash script, named script.sh that copies the JDBC driver from a location accessible from your cluster to ${UCD_HOME}/ext_lib/.
    3. Store the script script.sh in a yaml file describing a Kubernetes ConfigMap.

      The Kubernetes ConfigMap is defined for copying the JDBC driver to your Persistent Volume (PV) during the chart installation process.

      Below is an example ConfigMap yaml file that copies a MySQL .jar file from a web server using wget:
      kind: ConfigMap
      apiVersion: v1
      metadata:
        name: user-script
      data:
        script.sh: |
          #!/bin/bash
          echo "Running script.sh..."
          if [ ! -f ${UCD_HOME}/ext_lib/mysql-jdbc.jar ] ; then
            echo "Copying file(s)..."    
            wget -L -O mysql-jdbc.jar http://webserver-example/mysql-jdbc.jar
            mv mysql-jdbc.jar ${UCD_HOME}/ext_lib/
            echo "Done copying."
          else
            echo "File ${UCD_HOME}/ext_lib/mysql-jdbc.jar already exists."
          fi
    4. Create the ConfigMap in your cluster by running a command, such as:
      oc create configmap <map-name> <data-source>
    5. Specify the ConfigMap name in Helm using:
      ibm-ucd-prod.extLibVolume.configMapName

Results

You have collected all the required DevOps Loop container images, plugins, and JDBC drivers, and transferred them to your airgap image or offline storage, making the environment ready for air-gapped installation.