Mirroring images using an intermediary container registry

If your client workstation cannot connect to the internet and to the private container registry, you must mirror images to an intermediary container registry before you can mirror the images to your private container registry.

If your client workstation can connect to the internet and to the private container registry, see Mirroring images directly to the private container registry.

Installation phase
You are not here. Setting up a client workstation
You are not here. Collecting required information
You are here icon. Preparing your cluster
You are not here. Installing the Cloud Pak for Data platform and services
Who needs to complete this task?
A user with permissions to push images to the private container registry must complete this task.
When do you need to complete this task?
If you want to mirror images to a private container registry, you must complete this task in the following situations:
  • Before you install Cloud Pak for Data for the first time.
  • Before you upgrade to a newer release of Cloud Pak for Data

Before you begin

Best practice: You can run the commands in this task exactly as written if you set up environment variables. For instructions, see Setting up installation environment variables.

Ensure that you source the environment variables before you run the commands in this task.

About this task

Use the cpd-cli manage commands to:
  • Mirror the images from the IBM® Entitled Registry to an intermediary container registry on the client workstation.
  • Mirror the images from the intermediary container registry to the private container registry.

The cpd-cli manage mirror-images command automatically sets up an intermediary container registry on the client workstation. The address of the intermediary container registry is 127.0.0.1:12443.

You must be able to move the intermediary container registry behind your firewall.

Procedure

  1. From a client workstation that can connect to the internet:
    1. Log in to the IBM Entitled Registry registry:
      cpd-cli manage login-entitled-registry \
      ${IBM_ENTITLEMENT_KEY}
    2. Optional: Confirm that you have access to the images that you want to mirror from the IBM Entitled Registry:
      1. Inspect the IBM Entitled Registry:
        Tip: If you want to validate that you have access to the images for a specific component, you can run the following command before you run the list-images command:
        export COMPONENTS=<component-ID>
        cpd-cli manage list-images \
        --components=${COMPONENTS} \
        --release=${VERSION} \
        --inspect_source_registry=true

        The output is saved to the list_images.csv file in the cpd-cli-workspace/olm-utils-workspace/work/offline/${VERSION} directory.

      2. Check the output for errors:
        grep "level=fatal" list_images.csv

        The command returns images that failed because of authorization errors or network errors.

    3. Mirror the images to the intermediary container registry.

      The command automatically sets up an intermediary container registry on the client workstation. The address of the intermediary container registry is 127.0.0.1:12443.

      Tip: If you want to mirror images for a specific component, you can run export COMPONENTS=<component-ID> before you run the command.
      cpd-cli manage mirror-images \
      --components=${COMPONENTS} \
      --release=${VERSION} \
      --target_registry=127.0.0.1:12443

      For each component, the command generates a log file in the cpd-cli-workspace/olm-utils-workspace/work directory.

    4. Confirm that the images were mirrored to the intermediary container registry:
      1. Inspect the contents of the intermediary container registry:
        cpd-cli manage list-images \
        --components=${COMPONENTS} \
        --release=${VERSION} \
        --target_registry=127.0.0.1:12443 \
        --case_download=false

        The output is saved to the list_images.csv file in the cpd-cli-workspace/olm-utils-workspace/work/offline/${VERSION} directory.

      2. Check the output for errors:
        grep "level=fatal" list_images.csv

        The command returns images that are missing or that cannot be inspected.

  2. Move the intermediary container registry behind the firewall.

    Options for moving the intermediary container registry
    Option Details
    Use a portable compute device, such as a laptop, that you can move behind your firewall.
    You can use the same device to:
    • Mirror images from the IBM Entitled Registry to the intermediary container registry.
    • Mirror images from the intermediary container registry to the private container registry.
    Use a portable storage device, such as a USB drive, that you can move behind your firewall.
    You must set up two client workstations:
    • A workstation that can connect to the internet. From this workstation, you can mirror the images from the IBM Entitled Registry to the intermediary container registry on the portable storage device.
    • A workstation that can connect to the private container registry. After you move the portable storage device to this workstation, you can mirror the images from the intermediary container registry to the private container registry.
    Important: The workstation that can connect to the private container registry must have:
    • A copy of the cpd-cli
    • A copy of the cpd-cli-workspace/olm-utils-workspace/work directory, which contains the CASE packages and intermediary container registry.

      For simplicity, you can copy the entire cpd-cli-workspace directory.

    Use a file transfer protocol, such as scp or sftp, to move images behind your firewall.
    You must set up two client workstations:
    • A workstation that can connect to the internet. From this workstation, you can mirror the images from the IBM Entitled Registry to the intermediary container registry.
    • A workstation that can connect to the private container registry. After you transfer the intermediary container registry to this workstation, you can mirror the images from the intermediary container registry to the private container registry.
    Important: The workstation that can connect to the private container registry must have:
    • A copy of the cpd-cli
    • A copy of the cpd-cli-workspace/olm-utils-workspace/work directory, which contains the CASE packages and intermediary container registry.

      For simplicity, you can copy the entire cpd-cli-workspace directory.


  3. From a client workstation that connect to private container registry:
    1. Log in to the private container registry.

      The following command assumes that you are using private container registry that is secured with credentials:

      cpd-cli manage login-private-registry \
      ${PRIVATE_REGISTRY_LOCATION} \
      ${PRIVATE_REGISTRY_PUSH_USER} \
      ${PRIVATE_REGISTRY_PUSH_PASSWORD}

      If your private registry is not secured, see cpd-cli manage login-private-registry for additional options.

    2. Mirror the images from the intermediary container registry to the private container registry.
      Tip: If you want to mirror images for a specific component, you can run export COMPONENTS=<component-ID> before you run the command.
      cpd-cli manage mirror-images \
      --components=${COMPONENTS} \
      --release=${VERSION} \
      --source_registry=127.0.0.1:12443 \
      --target_registry=${PRIVATE_REGISTRY_LOCATION} \
      --case_download=false

      For each component, the command generates a log file in the cpd-cli-workspace/olm-utils-workspace/work directory.

    3. Confirm that the images were mirrored to the private container registry:
      1. Inspect the contents of the intermediary container registry:
        cpd-cli manage list-images \
        --components=${COMPONENTS} \
        --release=${VERSION} \
        --target_registry=${PRIVATE_REGISTRY_LOCATION} \
        --case_download=false

        The output is saved to the list_images.csv file in the cpd-cli-workspace/olm-utils-workspace/work/offline/${VERSION} directory.

      2. Check the output for errors:
        grep "level=fatal" list_images.csv

        The command returns images that are missing or that cannot be inspected.

What to do next

Now that you've mirrored the images to the private container registry, you are ready to Configuring an image content source policy.