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:
tar
format.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.
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:
imgpkg
yq
v4.9.2 or laterA 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.
On your internet-connected Linux machine:
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.
Set the repository from which to fetch Bill of Materials (BoM) YAML files.
export TKG_IMAGE_REPO="projects.registry.vmware.com/tkg"
publish-images-totar.sh
ScriptDownload the script named gen-publish-images-totar.sh
.
wget https://raw.githubusercontent.com/vmware-tanzu/tanzu-framework/main/hack/gen-publish-images-totar.sh
Make the gen-publish-images-totar.sh
script executable.
chmod +x gen-publish-images-totar.sh
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
Verify that the generated script contains the correct registry address.
cat publish-images-totar.sh
publish-images-totar.sh
ScriptMake the publish-images-totar.sh
script executable.
chmod +x publish-images-totar.sh
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
publish-images-fromtar.sh
ScriptDownload the script named gen-publish-images-fromtar.sh
.
wget https://raw.githubusercontent.com/vmware-tanzu/tanzu-framework/main/hack/gen-publish-images-fromtar.sh
Make the gen-publish-images-fromtar.sh
script executable.
chmod +x gen-publish-images-fromtar.sh
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
Verify that the generated script contains the correct registry address.
cat publish-images-fromtar.sh
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.
publish-images-fromtar.sh
ScriptOn your airgapped Linux machine:
Make the publish-images-fromtar.sh
script executable.
chmod +x publish-images-fromtar.sh
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