Mirror Images to Internal Registry¶
To be able to deploy Arrikto EKF in an air gapped environment, you have to mirror all the necessary images to an internal registry. This guide will walk you through mirroring the required images to either a private Amazon Elastic Container Registry (ECR), or an internal, self-hosted container registry.
Overview
What You’ll Need¶
- A configured management environment.
- Access to Arrikto’s Private Registry.
- Your clone of the Arrikto GitOps repository.
- Access to local Docker or running in a Docker-in-Docker environment on Kubernetes.
- Access to https://gcr.io/.
- Sufficient space (about 100 GB) for storing all images.
Procedure¶
Important
You will clone your GitOps repository under a temporary directory and reset any custom changes, to ensure that you mirror all the official images.
Switch to your management environment.
Configure Docker to access Arrikto’s private registry:
root@rok-tools:~# mkdir -p ~/.docker root@rok-tools:~# cp ~/ops/deployments/deploy/dockerconfig.json ~/.docker/config.jsonConfigure Docker to access your internal registry. Choose one of the following options based on who hosts your internal registry.
root@rok-tools:~# export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query 'Account' --output text) root@rok-tools:~# export AWS_DEFAULT_REGION=$(aws configure get region) root@rok-tools:~# aws ecr get-login-password | \ > docker login -u AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.comNote
This will use an ephemeral token that will last for 12 hours.
root@rok-tools:~# docker login registry.example.comSpecify where you want images to be mirrored, that is the internal registry along with an optional repository prefix. Choose one of the following options based on who hosts your internal registry.
root@rok-tools:~# export INTERNAL_REGISTRY=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/arriktoroot@rok-tools:~# export INTERNAL_REGISTRY=registry.example.com/arriktoClone your local GitOps repository under a temporary location:
root@rok-tools:~# mkdir -p ~/tmp root@rok-tools:~# git clone ~/ops/deployments ~/tmp/deploymentsGo to the temporary copy of your GitOps repository and reset any local changes:
root@rok-tools:~# cd ~/tmp/deployments root@rok-tools:~/tmp/deployments# git checkout release-2.0 root@rok-tools:~/tmp/deployments# git reset --hard rok/release-2.0-l0-release-2.0.1Get the list of all the necessary images:
root@rok-tools:~/tmp/deployments# rok-image-list -o imagesPull the images locally:
root@rok-tools:~/tmp/deployments# rok-image-pull --image-list imagesMirror the images to your internal registry. Choose one of the following options based on who hosts your internal registry.
root@rok-tools:~/tmp/deployments# rok-image-mirror --to ${INTERNAL_REGISTRY?} \ > --image-list images \ > --output-image-list mirrored-images \ > --push \ > --create-ecr-repositoriesroot@rok-tools:~/tmp/deployments# rok-image-mirror --to ${INTERNAL_REGISTRY?} \ > --image-list images \ > --output-image-list mirrored-images \ > --pushOptional
Save images as tarballs locally:
root@rok-tools:~/tmp/deployments# rok-image-mirror --to ${INTERNAL_REGISTRY?} \ > --image-list images \ > --output-image-list mirrored-images \ > --save \ > --save-dir /root/imagesGo to your GitOps repository and copy the generated list of images:
root@rok-tools:~/tmp/deployments# cd ~/ops/deployments root@rok-tools:~/ops/deployments# cp ~/tmp/deployments/{images,mirrored-images} .Stage your changes:
root@rok-tools:~/ops/deployments# git add images mirrored-imagesCommit your changes:
root@rok-tools:~/ops/deployments# git commit -am "Track list of images to mirror"Delete the temporary copy of your GitOps repository:
root@rok-tools~/ops/deployments# rm -r ~/tmp/deployments