This topic explains how to copy the container images required to deploy Tanzu Kubernetes Grid on vSphere or AWS to a private registry in a physically-airgapped, offline environment. This procedure uses the scripts gen-publish-images-totar.sh, publish-images-totar.sh and gen-publish-images-fromtar.sh to:

  • Copy the images from the Tanzu Kubernetes Grid public registry and save them locally in tar format.
  • Extract the images from tar files and copy them to a private registry.

Note: To deploy Tanzu Kubernetes Grid in an environment with limited Internet access, such as a proxied environment, see Prepare an Internet-Restricted Environment. The procedure below is equivalent to Step 2: Generate the publish-images Script and Step 3: Run the publish-images Script in that topic.

Prerequisites

To copy the Tanzu Kubernetes Grid images into the airgapped registry, you need:

  • An Internet-connected Linux machine outside the airgapped environment, with the following installed:

  • A Linux machine inside the airgapped environment, with the following installed:

  • A USB thumb drive or other portable offline storage device.

Please follow Steps 1-4 on your internet-connected Linux machine.

Step 1: Set Environment Variables

On your internet-connected Linux machine:

  1. Set the IP address or FQDN of your private registry as an environment variable:

    export TKG_CUSTOM_IMAGE_REPOSITORY="PRIVATE-REGISTRY"
    

    Where PRIVATE-REGISTRY is the IP address or FQDN of your private registry and the name of the project. For example, custom-image-repository.io/yourproject.

  2. Set the repository from which to fetch Bill of Materials (BoM) YAML files.

    export TKG_IMAGE_REPO="projects.registry.vmware.com/tkg"
    

Step 2: Generate the publish-images-totar.sh Script

  1. Download the script named gen-publish-images-totar.sh.

    wget https://raw.githubusercontent.com/vmware-tanzu/tanzu-framework/main/hack/gen-publish-images-totar.sh
    
  2. Make the gen-publish-images-totar.sh script executable.

    chmod +x gen-publish-images-totar.sh
    
  3. Generate a publish-images-totar.sh shell script that is populated with the address of your private Docker registry.

    ./gen-publish-images-totar.sh > publish-images-totar.sh
    
  4. Verify that the generated script contains the correct registry address.

    cat publish-images-totar.sh
    

Step 3: Run the publish-images-totar.sh Script

  1. Make the publish-images-totar.sh script executable.

    chmod +x publish-images-totar.sh
    
  2. Run the publish-images-totar.sh script to pull the required images from the public Tanzu Kubernetes Grid registry and save them locally in tar format.

    ./publish-images-totar.sh
    

Step 4: Generate the publish-images-fromtar.sh Script

  1. Download the script named gen-publish-images-fromtar.sh.

    wget https://raw.githubusercontent.com/vmware-tanzu/tanzu-framework/main/hack/gen-publish-images-fromtar.sh
    
  2. Make the gen-publish-images-fromtar.sh script executable.

    chmod +x gen-publish-images-fromtar.sh
    
  3. Generate a publish-images-fromtar.sh shell script that is populated with the address of your private Docker registry.

    ./gen-publish-images-fromtar.sh > publish-images-fromtar.sh
    
  4. Verify that the generated script contains the correct registry address.

    cat publish-images-fromtar.sh
    

Step 5: Copy Files to Airgapped Environment

Use a USB thumb drive or other storage medium to copy the tar files and publish-images-fromtar.sh script to the Linux machine in the airgapped environment that hosts or can access your private registry.

Step 6: Run the publish-images-fromtar.sh Script

On your airgapped Linux machine:

  1. Make the publish-images-fromtar.sh script executable.

    chmod +x publish-images-fromtar.sh
    
  2. Run the publish-images-fromtar.sh script to extract the required images from the tar files and push them to your private registry.

    ./publish-images-fromtar.sh
    
check-circle-line exclamation-circle-line close-line
Scroll to top icon