Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: added Documentation for Air-Gapped Installation #5360

Merged
merged 22 commits into from
Aug 23, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions devtron-images.txt.source
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
quay.io/devtron/image-scanner:3ab2ba46-141-23064
quay.io/devtron/inception:473deaa4-185-21582
public.ecr.aws/docker/library/redis:7.0.5-alpine
quay.io/argoproj/argocd:v2.5.2
quay.io/argoproj/workflow-controller:v3.4.3
quay.io/devtron/authenticator:e414faff-393-13273
quay.io/devtron/bats:v1.4.1
quay.io/devtron/busybox:1.31.1
quay.io/devtron/chart-sync:b67ab589-150-23082
quay.io/devtron/curl:7.73.0
quay.io/devtron/dashboard:87aaf7ac-690-23135
quay.io/devtron/devtron-utils:dup-chart-repo-v1.1.0
quay.io/devtron/devtron:3aa7e420-434-23146
quay.io/devtron/dex:v2.30.2
quay.io/devtron/git-sensor:8545feb5-200-22005
quay.io/devtron/grafana:7.3.1
quay.io/devtron/k8s-sidecar:1.1.0
quay.io/devtron/k8s-utils:tutum-curl
quay.io/devtron/kubectl:latest
quay.io/devtron/kubelink:a810dbae-564-23055
quay.io/devtron/kubewatch:f8ac0fe6-419-23054
quay.io/devtron/lens:3d3e8f08-333-23057
quay.io/devtron/migrator:v4.16.2
quay.io/devtron/nats-box
quay.io/devtron/nats-server-config-reloader:0.6.2
quay.io/devtron/nats:2.9.3-alpine
quay.io/devtron/notifier:924a17f6-372-22110
quay.io/devtron/postgres:11.9
quay.io/devtron/postgres_exporter:v0.10.1
quay.io/devtron/prometheus-nats-exporter:0.9.0
quay.io/devtron/minio:RELEASE.2021-02-14T04-01-33Z
quay.io/devtron/clair:4.3.6
quay.io/devtron/postgres:11.9.0-debian-10-r26
quay.io/devtron/postgres_exporter:v0.4.7
quay.io/devtron/minio-mc:RELEASE.2021-02-14T04-28-06Z
quay.io/devtron/minideb:latest

1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* [Install Devtron with CI/CD and GitOps (Argo CD)](setup/install/install-devtron-with-cicd-with-gitops.md)
* [Install Devtron without Integrations](setup/install/install-devtron.md)
* [Install Devtron on Minikube, Microk8s, K3s, Kind, Cloud VMs](setup/install/Install-devtron-on-Minikube-Microk8s-K3s-Kind.md)
* [Install Devtron on Airgapped environment](setup/install/install-devtron-in-airgapped-environment.md)
* [Demo on Popular Cloud Providers](setup/install/demo-tutorials.md)
* [Backup for Disaster Recovery](setup/install/devtron-backup.md)
* [Uninstall Devtron](setup/install/uninstall-devtron.md)
Expand Down
200 changes: 200 additions & 0 deletions docs/setup/install/install-devtron-in-airgapped-environment.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
# Devtron Full Mode Installation in an Airgapped Environment
badal773 marked this conversation as resolved.
Show resolved Hide resolved

## Pre-requisites

1. Install `podman` or `docker` and `yq` on the VM from where you're executing the installation commands.
badal773 marked this conversation as resolved.
Show resolved Hide resolved
2. Clone the Devtron Helm chart:

```bash
git clone https://github.com/devtron-labs/devtron.git
cd devtron
```


4. Set the value 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.

## Docker Instructions

### For Linux/amd64
badal773 marked this conversation as resolved.
Show resolved Hide resolved

1. Set the environment variables:

```bash
# Set the source registry URL
export SOURCE_REGISTRY="quay.io/devtron"

# Set the target registry URL, username, and token/password
export TARGET_REGISTRY_URL=""
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}"
```

2. Log in to the target Docker registry:

```bash
docker login -u $TARGET_REGISTRY_USERNAME -p $TARGET_REGISTRY_TOKEN $TARGET_REGISTRY_URL
```

3. Clone the images:

```bash
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_URL}"

# 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_URL}"

# 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_URL}"
fi

# Pull the image from the source registry
docker pull --platform linux/amd64 $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 images file
echo "$target_image" >> "$TARGET_IMAGES_LIST"

done < "$SOURCE_IMAGES_LIST"
```

### For Linux/arm64

1. Set the environment variables:

```bash
# Set the source registry URL
export SOURCE_REGISTRY="quay.io/devtron"

# Set the target registry URL, username, and token/password
export TARGET_REGISTRY_URL=""
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}"
```

2. Log in to the target Docker registry:

```bash
docker login -u $TARGET_REGISTRY_USERNAME -p $TARGET_REGISTRY_TOKEN $TARGET_REGISTRY_URL
```

3. Clone the images:

```bash
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_URL}"

# 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_URL}"

# 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_URL}"
fi

# Pull the image from the source registry
docker pull --platform linux/arm64 $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 images file
echo "$target_image" >> "$TARGET_IMAGES_LIST"

done < "$SOURCE_IMAGES_LIST"
```

## Podman Instructions

### For Multi-arch

1. Set the environment variables:

```bash
export SOURCE_REGISTRY="quay.io/devtron"
export SOURCE_REGISTRY_TOKEN=#Enter token provided by Devtron team
export TARGET_REGISTRY=#Enter target registry url
export TARGET_REGISTRY_USERNAME=#Enter target registry username
export TARGET_REGISTRY_TOKEN=#Enter target registry token/password
```

2. Log in to the target Podman registry:

```bash
podman login -u $TARGET_REGISTRY_USERNAME -p $TARGET_REGISTRY_TOKEN $TARGET_REGISTRY
```

3. Clone the images:

```bash
SOURCE_REGISTRY="quay.io/devtron"
TARGET_REGISTRY=${TARGET_REGISTRY}
SOURCE_IMAGES_FILE_NAME="${SOURCE_IMAGES_FILE_NAME:=devtron-images.txt.source}"
TARGET_IMAGES_FILE_NAME="${TARGET_IMAGES_FILE_NAME:=devtron-images.txt.target}"

cp $SOURCE_IMAGES_FILE_NAME $TARGET_IMAGES_FILE_NAME
while read source_image; do
if [[ "$source_image" == *"workflow-controller:"* || "$source_image" == *"argoexec:"* || "$source_image" == *"argocd:"* ]]
then
SOURCE_REGISTRY="quay.io/argoproj"
sed -i "s|${SOURCE_REGISTRY}|${TARGET_REGISTRY}|g" $TARGET_IMAGES_FILE_NAME
elif [[ "$source_image" == *"redis:"* ]]
then
SOURCE_REGISTRY="public.ecr.aws/docker/library"
sed -i "s|${SOURCE_REGISTRY}|${TARGET_REGISTRY}|g" $TARGET_IMAGES_FILE_NAME
else
SOURCE_REGISTRY="quay.io/devtron"
sed -i "s|${SOURCE_REGISTRY}|${TARGET_REGISTRY}|g" $TARGET_IMAGES_FILE_NAME
fi
done <$SOURCE_IMAGES_FILE_NAME
echo "Target Images file finalized"

while read -r -u 3 source_image && read -r -u 4 target_image ; do
echo "Pushing $source_image $target_image"
podman manifest create $source_image
podman manifest add $source_image $source_image --all
podman manifest push $source_image $target_image --all
done 3<"$SOURCE_IMAGES_FILE_NAME" 4<"$TARGET_IMAGES_FILE_NAME"
```

## Final Step
badal773 marked this conversation as resolved.
Show resolved Hide resolved

Change your registry name in `values.yaml` at line number 10:

```bash
yq e '.global.containerRegistry = "<your-registry-name>"' -i /charts/devtron/values.yaml
Loading