Skip to content

Commit d500fbf

Browse files
Badal Kumar PrustyBadal Kumar Prusty
authored andcommitted
added changes
1 parent fe04b36 commit d500fbf

File tree

1 file changed

+32
-65
lines changed

1 file changed

+32
-65
lines changed

docs/setup/install/install-devtron-in-airgapped-environment.md

Lines changed: 32 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
# Devtron Full Mode Installation in an Airgapped Environment
1+
# Devtron Installation in an Airgapped Environment
22

33
## Introduction
44

55
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.
66

77
### Prerequisites
88

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

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

2626
## Docker Instructions
2727

28-
### For Linux/amd64
28+
### Platform Selection
2929

30-
1. Set the environment variables
30+
#### For Linux/amd64
3131

3232
```bash
33-
# Set the source registry URL
34-
export SOURCE_REGISTRY="quay.io/devtron"
35-
36-
# Set the target registry URL, username, and token/password
37-
export TARGET_REGISTRY=""
38-
export TARGET_REGISTRY_USERNAME=""
39-
export TARGET_REGISTRY_TOKEN=""
40-
41-
# Set the source and target image file names with default values if not already set
42-
SOURCE_IMAGES_LIST="${SOURCE_IMAGES_LIST:=devtron-images.txt.source}"
43-
TARGET_IMAGES_LIST="${TARGET_IMAGES_LIST:=devtron-images.txt.target}"
33+
export PLATFORM="linux/amd64"
4434
```
45-
46-
2. Log in to the target Docker registry
35+
#### For Linux/arm64
4736

4837
```bash
49-
docker login -u $TARGET_REGISTRY_USERNAME -p $TARGET_REGISTRY_TOKEN $TARGET_REGISTRY
38+
export PLATFORM="linux/arm64"
5039
```
5140

52-
3. Clone the images
53-
54-
```bash
55-
while IFS= read -r source_image; do
56-
# Check if the source image belongs to the quay.io/devtron registry
57-
if [[ "$source_image" == quay.io/devtron/* ]]; then
58-
# Replace the source registry with the target registry in the image name
59-
target_image="${source_image/quay.io\/devtron/$TARGET_REGISTRY}"
60-
61-
# Check if the source image belongs to the quay.io/argoproj registry
62-
elif [[ "$source_image" == quay.io/argoproj/* ]]; then
63-
# Replace the source registry with the target registry in the image name
64-
target_image="${source_image/quay.io\/argoproj/$TARGET_REGISTRY}"
65-
66-
# Check if the source image belongs to the public.ecr.aws/docker/library registry
67-
elif [[ "$source_image" == public.ecr.aws/docker/library/* ]]; then
68-
# Replace the source registry with the target registry in the image name
69-
target_image="${source_image/public.ecr.aws\/docker\/library/$TARGET_REGISTRY}"
70-
fi
71-
72-
# Pull the image from the source registry
73-
docker pull --platform linux/amd64 $source_image
74-
75-
# Tag the image with the new target registry name
76-
docker tag $source_image $target_image
77-
78-
# Push the image to the target registry
79-
docker push $target_image
80-
81-
# Output the updated image name
82-
echo "Updated image: $target_image"
83-
84-
# Append the new image name to the target image file
85-
echo "$target_image" >> "$TARGET_IMAGES_LIST"
86-
87-
done < "$SOURCE_IMAGES_LIST"
88-
```
8941

90-
### For Linux/arm64
9142

9243
1. Set the environment variables
9344

@@ -132,7 +83,7 @@ If you are using Docker, the TARGET_REGISTRY should be in the format `docker.io/
13283
fi
13384
13485
# Pull the image from the source registry
135-
docker pull --platform linux/arm64 $source_image
86+
docker pull --platform $PLATFORM $source_image
13687
13788
# Tag the image with the new target registry name
13889
docker tag $source_image $target_image
@@ -148,7 +99,6 @@ If you are using Docker, the TARGET_REGISTRY should be in the format `docker.io/
14899
149100
done < "$SOURCE_IMAGES_LIST"
150101
```
151-
152102
---
153103

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

218168
2. Create the Docker registry secret
219169
```bash
220-
kubectl create secret docker-registry regcred \
170+
kubectl create secret docker-registry devtron-imagepull \
221171
--namespace devtroncd \
222172
--docker-server=$TARGET_REGISTRY \
223173
--docker-username=$TARGET_REGISTRY_USERNAME \
224174
--docker-password=$TARGET_REGISTRY_TOKEN
225175
```
176+
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-:
177+
```bash
178+
kubectl create secret docker-registry devtron-imagepull \
179+
--namespace devtron-cd \
180+
--docker-server=$TARGET_REGISTRY \
181+
--docker-username=$TARGET_REGISTRY_USERNAME \
182+
--docker-password=$TARGET_REGISTRY_TOKEN
183+
kubectl create secret docker-registry devtron-imagepull \
184+
--namespace devtron-ci \
185+
--docker-server=$TARGET_REGISTRY \
186+
--docker-username=$TARGET_REGISTRY_USERNAME \
187+
--docker-password=$TARGET_REGISTRY_TOKEN
188+
kubectl create secret docker-registry devtron-imagepull \
189+
--namespace argo \
190+
--docker-server=$TARGET_REGISTRY \
191+
--docker-username=$TARGET_REGISTRY_USERNAME \
192+
--docker-password=$TARGET_REGISTRY_TOKEN
193+
```
226194

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

242210
2. With `imagePullSecrets`:
243211
```bash
244-
helm install devtron . -n devtroncd --set global.containerRegistry="$TARGET_REGISTRY" --set global.imagePullSecrets[0].name=regcred
212+
helm install devtron . -n devtroncd --set global.containerRegistry="$TARGET_REGISTRY" --set global.imagePullSecrets[0].name=devtron-imagepull
245213
```
246214

247-
### Install Devtron with CI/CD Module Only
248-
215+
### Installing Devtron with CI/CD Module Only
249216
Use the below command to install Devtron with only the CI/CD module
250217

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

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

261-
### Install Devtron with Argo CD
228+
### Install Devtron with CICD Mode including Argocd
262229

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

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

270237
2. With `imagePullSecrets`:
271238
```bash
272-
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
239+
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
273240
```
274241

275242
---

0 commit comments

Comments
 (0)