The prerequisites for installing with or without OLM in airgap are the same. Begin by
downloading the Operator case, logging in to the necessary repositories, and mirroring the container
images
Before you begin
- Install the
yq command-line Yaml processor. For more information, see yq usage guide.
- Install any of the container tools- Docker or Podman. For more information, see Docker and Podman.
- Install skopeo, a utility to perform various operations on container images and image
repositories. For more information, see skopeo.
- A local registry to store the mirrored images.
About this task
The following steps 2 and 3 use skopeo commands, however you can use either of Docker,
Podman, or skopeo commands.
Procedure
- Download and extract the case.
- Set the CASE_VERSION of the Operator that you want to install. For EDITION, use
ent for Enterprise and pro for
Professional.export CASE_VERSION="3.0.26"
export EDITION="ent"
- Download the
case.
curl -O https://raw.githubusercontent.com/IBM/cloud-pak/master/repo/case/ibm-oms-$EDITION-case/$CASE_VERSION/ibm-oms-$EDITION-case-$CASE_VERSION.tgz
- Extract the case.
tar -xzf ibm-oms-$EDITION-case-$CASE_VERSION.tgz
- Log in to source and target repositories to mirror the images.
- To authenticate with the entitled registry and enable image pulls, run the following
command.
skopeo login icr.io
- If your local registry requires authentication to push images, use the following command.
Replace
your-local-registry with the URL of your local
registry.skopeo login your-local-registry
- Mirror the container images by using the following commands. Replace
EDITION and TARGET_REPO with the edition and the repository that
you want. The container images are retrieved from the source registry and uploaded to
your local registry to enable offline installation.
export TARGET_REPO="docker.io/my_username/my_repo"
export EDITION="ent"
export SOURCE_REPO="icr.io"
export CAP_EDITION=$(echo "$EDITION" | awk '{print toupper(substr($0,1,1)) tolower(substr($0,2))}')
export OP_CASE_INVENTORY="ibm-oms-${EDITION}-case/inventory/ibmOms${CAP_EDITION}ProdSetup"
export APP_CASE_INVENTORY="ibm-oms-${EDITION}-case/inventory/ibmOms${CAP_EDITION}Prod"
export CASE_INVENTORIES=("$OP_CASE_INVENTORY" "$APP_CASE_INVENTORY")
echo "Mirroring images from $SOURCE_REPO to $TARGET_REPO..."
for INVENTORY in "${CASE_INVENTORIES[@]}"; do
echo -e "\nProcessing inventory: $INVENTORY"
IMAGES_AND_TAGS=$(
yq e '
.resources.resourceDefs.containerImages[].image
+ ":"
+ .resources.resourceDefs.containerImages[].tag
' $APP_CASE_INVENTORY/resources.yaml
)
while IFS= read -r img; do
tgt_img_and_tag=$(echo "$img" | awk -F'/' '{print $NF}')
echo "Copy $SOURCE_REPO/$img to $TARGET_REPO/$tgt_img_and_tag"
skopeo copy --all --remove-signatures \
docker://$SOURCE_REPO/$img \
docker://$TARGET_REPO/$tgt_img_and_tag
done <<< "$IMAGES_AND_TAGS"
done