Preparing images and resources for an air-gapped installation

Before you begin the air-gapped installation of DevOps Loop, you must prepare all the required container images and resources. In an air-gapped environment, external repositories are not accessible, and therefore, you must collect and transfer all required assets to your internal registry or offline storage.

Before you begin

You must have completed the following tasks:
  • Gained 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.
  • Installed the skopeo utility on your local machine and authenticated with the required image registries.
  • Allocated sufficient disk space to save product images and plugin files for transfer to the air-gapped environment.
    Note: Product images consume approximately 50 GB or more of disk space in your internal/air-gapped image registry.

About this task

Copy DevOps Loop images by using a jump server

Copy DevOps Loop images directly to the internal registry by using a jump server. You can use this method when a system can connect to both the public internet and the air-gapped image registry.

Run the following command to copy the images directly to the internal registry:
sh ./ibm-devops-loop/scripts/airgap/airgap.sh -r ibm-devops-loop -d registry.local:5000/devops-loop
DevOps Loop images are copied directly to the internal image registry.

OR

Copy DevOps Loop images by using file-based transfer

Copy DevOps Loop images to an air-gapped environment by using file-based image archives. You can use this method when no system has access to both the public internet and the air-gapped environment.

  1. Run the following command on a machine with internet access:
    sh ibm-devops-loop/scripts/airgap/airgap.sh -r ibm-devops-loop -d loopimagesdir -x save -y
  2. Transfer the loopimagesdir directory to a machine inside the air-gapped environment.
  3. Run the following command to load the images into the internal registry:
    sh ibm-devops-loop/scripts/airgap/airgap.sh -r ibm-devops-loop -d airgap.registry.io/loopimages -s loopimagesdir -x load 
DevOps Loop images are available in the internal air-gapped image registry.

Prepare MongoDB for an air-gapped installation

You must prepare MongoDB for air-gapped installation by making the required Helm chart available locally and updating the configuration to use images from your internal 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 as follows:
    • Set MONGO_IMAGE_REPO=registry.local:5000/devops-loop.
    • Replace bitnami/mongodb with mongodb in the helm upgrade --install command.

Prepare MySQL JDBC driver

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 driver available manually before starting the DevOps Loop installation.

  1. Download the required MySQL JDBC driver and make it accessible within the 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.
    Here 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 the following command:
    oc create configmap <map-name> <data-source>
  5. Reference the ConfigMap name in Helm by using the following command:
    ibm-ucd-prod.extLibVolume.configMapName
You have copied all required DevOps Loop images and prepared the necessary resources, including MongoDB and the MySQL JDBC driver. Your internal registry or offline storage now contains all required artifacts.
You can begin the air-gapped installation of DevOps Loop. See Installing DevOps Loop in an air-gapped environment.