In certain scenarios, you may need to deploy Devtron to a Kubernetes cluster that isn’t connected to the internet. Such air-gapped environments are used for various reasons, particularly in industries with strict regulatory requirements like healthcare, banking, and finance. This is because air-gapped environments aren't exposed to the public internet; therefore, they create a controlled and secure space for handling sensitive data and operations.
Prerequisites
Install podman or docker on the VM from where you're executing the installation commands.
Clone the Devtron Helm chart:
git clone https://github.com/devtron-labs/devtron.git
cd devtron
Set the values of TARGET_REGISTRY, TARGET_REGISTRY_USERNAME, and TARGET_REGISTRY_TOKEN. This registry should be accessible from the VM where you are running the cloning script and the K8s cluster where you’re installing Devtron.
Note
If you are using Docker, the TARGET_REGISTRY should be in the format docker.io/<USERNAME>
Docker Instructions
Platform Selection
For Linux/amd64
```bash
export PLATFORM="linux/amd64"
```
For Linux/arm64
```bash
export PLATFORM="linux/arm64"
```
Set the environment variables
# Set the source registry URL
export SOURCE_REGISTRY="quay.io/devtron"
# Set the target registry URL, username, and token/password
export TARGET_REGISTRY=""
export TARGET_REGISTRY_USERNAME=""
export TARGET_REGISTRY_TOKEN=""
# Set the source and target image file names with default values if not already set
SOURCE_IMAGES_LIST="${SOURCE_IMAGES_LIST:=devtron-images.txt.source}"
TARGET_IMAGES_LIST="${TARGET_IMAGES_LIST:=devtron-images.txt.target}"
while IFS= read -r source_image; do
# Check if the source image belongs to the quay.io/devtron registry
if [[ "$source_image" == quay.io/devtron/* ]]; then
# Replace the source registry with the target registry in the image name
target_image="${source_image/quay.io\/devtron/$TARGET_REGISTRY}"
# Check if the source image belongs to the quay.io/argoproj registry
elif [[ "$source_image" == quay.io/argoproj/* ]]; then
# Replace the source registry with the target registry in the image name
target_image="${source_image/quay.io\/argoproj/$TARGET_REGISTRY}"
# Check if the source image belongs to the public.ecr.aws/docker/library registry
elif [[ "$source_image" == public.ecr.aws/docker/library/* ]]; then
# Replace the source registry with the target registry in the image name
target_image="${source_image/public.ecr.aws\/docker\/library/$TARGET_REGISTRY}"
fi
# Pull the image from the source registry
docker pull --platform $PLATFORM $source_image
# Tag the image with the new target registry name
docker tag $source_image $target_image
# Push the image to the target registry
docker push $target_image
# Output the updated image name
echo "Updated image: $target_image"
# Append the new image name to the target image file
echo "$target_image" >> "$TARGET_IMAGES_LIST"
done < "$SOURCE_IMAGES_LIST"