Skip to content

Commit

Permalink
added changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Badal Kumar Prusty authored and Badal Kumar Prusty committed Aug 23, 2024
1 parent fe04b36 commit d500fbf
Showing 1 changed file with 32 additions and 65 deletions.
97 changes: 32 additions & 65 deletions docs/setup/install/install-devtron-in-airgapped-environment.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Devtron Full Mode Installation in an Airgapped Environment
# Devtron Installation in an Airgapped Environment

## Introduction

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

1. Install `podman` or `docker` and `yq` on the VM from where you're executing the installation commands.
1. Install `podman` or `docker` on the VM from where you're executing the installation commands.
2. Clone the Devtron Helm chart:

```bash
Expand All @@ -25,69 +25,20 @@ If you are using Docker, the TARGET_REGISTRY should be in the format `docker.io/

## Docker Instructions

### For Linux/amd64
### Platform Selection

1. Set the environment variables
#### For Linux/amd64

```bash
# 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}"
export PLATFORM="linux/amd64"
```

2. Log in to the target Docker registry
#### For Linux/arm64

```bash
docker login -u $TARGET_REGISTRY_USERNAME -p $TARGET_REGISTRY_TOKEN $TARGET_REGISTRY
export PLATFORM="linux/arm64"
```

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}"
# 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 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 image file
echo "$target_image" >> "$TARGET_IMAGES_LIST"
done < "$SOURCE_IMAGES_LIST"
```

### For Linux/arm64

1. Set the environment variables

Expand Down Expand Up @@ -132,7 +83,7 @@ If you are using Docker, the TARGET_REGISTRY should be in the format `docker.io/
fi
# Pull the image from the source registry
docker pull --platform linux/arm64 $source_image
docker pull --platform $PLATFORM $source_image
# Tag the image with the new target registry name
docker tag $source_image $target_image
Expand All @@ -148,7 +99,6 @@ If you are using Docker, the TARGET_REGISTRY should be in the format `docker.io/
done < "$SOURCE_IMAGES_LIST"
```

---

## Podman Instructions
Expand Down Expand Up @@ -217,12 +167,30 @@ Before starting, ensure you have created an image pull secret for your registry

2. Create the Docker registry secret
```bash
kubectl create secret docker-registry regcred \
kubectl create secret docker-registry devtron-imagepull \
--namespace devtroncd \
--docker-server=$TARGET_REGISTRY \
--docker-username=$TARGET_REGISTRY_USERNAME \
--docker-password=$TARGET_REGISTRY_TOKEN
```
If you are installing Devtron with the CI/CD module or using Argo CD, create the secret in the following namespaces else, you can skip this step-:
```bash
kubectl create secret docker-registry devtron-imagepull \
--namespace devtron-cd \
--docker-server=$TARGET_REGISTRY \
--docker-username=$TARGET_REGISTRY_USERNAME \
--docker-password=$TARGET_REGISTRY_TOKEN
kubectl create secret docker-registry devtron-imagepull \
--namespace devtron-ci \
--docker-server=$TARGET_REGISTRY \
--docker-username=$TARGET_REGISTRY_USERNAME \
--docker-password=$TARGET_REGISTRY_TOKEN
kubectl create secret docker-registry devtron-imagepull \
--namespace argo \
--docker-server=$TARGET_REGISTRY \
--docker-username=$TARGET_REGISTRY_USERNAME \
--docker-password=$TARGET_REGISTRY_TOKEN
```

3. Navigate to the Devtron Helm chart directory
```bash
Expand All @@ -241,11 +209,10 @@ Use the below command to install Devtron without any Integrations

2. With `imagePullSecrets`:
```bash
helm install devtron . -n devtroncd --set global.containerRegistry="$TARGET_REGISTRY" --set global.imagePullSecrets[0].name=regcred
helm install devtron . -n devtroncd --set global.containerRegistry="$TARGET_REGISTRY" --set global.imagePullSecrets[0].name=devtron-imagepull
```

### Install Devtron with CI/CD Module Only

### Installing Devtron with CI/CD Module Only
Use the below command to install Devtron with only the CI/CD module

1. Without `imagePullSecrets`:
Expand All @@ -255,10 +222,10 @@ Use the below command to install Devtron with only the CI/CD module

2. With `imagePullSecrets`:
```bash
helm install devtron . -n devtroncd --set installer.modules={cicd} --set global.containerRegistry="$TARGET_REGISTRY" --set global.imagePullSecrets[0].name=regcred
helm install devtron . -n devtroncd --set installer.modules={cicd} --set global.containerRegistry="$TARGET_REGISTRY" --set global.imagePullSecrets[0].name=devtron-imagepull
```

### Install Devtron with Argo CD
### Install Devtron with CICD Mode including Argocd

Use the below command to install Devtron with the CI/CD module and Argo CD

Expand All @@ -269,7 +236,7 @@ Use the below command to install Devtron with the CI/CD module and Argo CD

2. With `imagePullSecrets`:
```bash
helm install devtron . --create-namespace -n devtroncd --set installer.modules={cicd} --set argo-cd.enabled=true --set global.containerRegistry="$TARGET_REGISTRY" --set argo-cd.global.image.repository="${TARGET_REGISTRY}/argocd" --set argo-cd.redis.image.repository="${TARGET_REGISTRY}/redis" --set global.imagePullSecrets[0].name=regcred
helm install devtron . --create-namespace -n devtroncd --set installer.modules={cicd} --set argo-cd.enabled=true --set global.containerRegistry="$TARGET_REGISTRY" --set argo-cd.global.image.repository="${TARGET_REGISTRY}/argocd" --set argo-cd.redis.image.repository="${TARGET_REGISTRY}/redis" --set global.imagePullSecrets[0].name=devtron-imagepull
```

---
Expand Down

0 comments on commit d500fbf

Please sign in to comment.