Skip to content

Commit b670d3c

Browse files
authored
Merge branch 'devtron-labs:main' into app-metrics
2 parents 3b20ee6 + cf2254f commit b670d3c

File tree

3 files changed

+230
-32
lines changed

3 files changed

+230
-32
lines changed

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

+14-14
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ In certain scenarios, you may need to deploy Devtron to a Kubernetes cluster tha
77
### Prerequisites
88

99
1. Install `podman` or `docker` on the VM from where you're executing the installation commands.
10-
2. Clone the Devtron Helm chart:
10+
2. Get the latest image file
1111

1212
```bash
13-
git clone https://github.com/devtron-labs/devtron.git
14-
cd devtron
13+
curl -LO https://raw.githubusercontent.com/devtron-labs/devtron/refs/heads/main/devtron-images.txt.source
1514
```
1615

1716
3. 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.
@@ -173,7 +172,7 @@ Before starting, ensure you have created an image pull secret for your registry
173172
--docker-username=$TARGET_REGISTRY_USERNAME \
174173
--docker-password=$TARGET_REGISTRY_TOKEN
175174
```
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-:
175+
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-:
177176
```bash
178177
kubectl create secret docker-registry devtron-imagepull \
179178
--namespace devtron-cd \
@@ -192,37 +191,38 @@ Before starting, ensure you have created an image pull secret for your registry
192191
--docker-password=$TARGET_REGISTRY_TOKEN
193192
```
194193

195-
3. Navigate to the Devtron Helm chart directory
196-
```bash
197-
cd charts/devtron
198-
```
194+
### Get the latest Devtron Helm Chart
199195

196+
``` bash
197+
helm pull devtron-operator --repo http://helm.devtron.ai
198+
```
199+
This would download the tar file of the devtron-operator chart, Make sure to replace the `<devtron-chart-file>` in the installation commands with this file name.
200200

201201
### Install Devtron without any Integration
202202

203203
Use the below command to install Devtron without any Integrations
204204

205205
1. Without `imagePullSecrets`:
206206
```bash
207-
helm install devtron . -n devtroncd --set global.containerRegistry="$TARGET_REGISTRY"
207+
helm install devtron <devtron-chart-file> -n devtroncd --set global.containerRegistry="$TARGET_REGISTRY" --set-string components.devtron.customOverrides.IS_AIR_GAP_ENVIRONMENT=true
208208
```
209209

210210
2. With `imagePullSecrets`:
211211
```bash
212-
helm install devtron . -n devtroncd --set global.containerRegistry="$TARGET_REGISTRY" --set global.imagePullSecrets[0].name=devtron-imagepull
212+
helm install devtron <devtron-chart-file> -n devtroncd --set global.containerRegistry="$TARGET_REGISTRY" --set global.imagePullSecrets[0].name=devtron-imagepull --set-string components.devtron.customOverrides.IS_AIR_GAP_ENVIRONMENT=true
213213
```
214214

215215
### Installing Devtron with CI/CD Mode
216216
Use the below command to install Devtron with only the CI/CD module
217217

218218
1. Without `imagePullSecrets`:
219219
```bash
220-
helm install devtron . -n devtroncd --set installer.modules={cicd} --set global.containerRegistry="$TARGET_REGISTRY"
220+
helm install devtron <devtron-chart-file> -n devtroncd --set installer.modules={cicd} --set global.containerRegistry="$TARGET_REGISTRY" --set-string components.devtron.customOverrides.IS_AIR_GAP_ENVIRONMENT=true
221221
```
222222

223223
2. With `imagePullSecrets`:
224224
```bash
225-
helm install devtron . -n devtroncd --set installer.modules={cicd} --set global.containerRegistry="$TARGET_REGISTRY" --set global.imagePullSecrets[0].name=devtron-imagepull
225+
helm install devtron <devtron-chart-file> -n devtroncd --set installer.modules={cicd} --set global.containerRegistry="$TARGET_REGISTRY" --set global.imagePullSecrets[0].name=devtron-imagepull --set-string components.devtron.customOverrides.IS_AIR_GAP_ENVIRONMENT=true
226226
```
227227

228228
### Install Devtron with CICD Mode including Argocd
@@ -231,12 +231,12 @@ Use the below command to install Devtron with the CI/CD module and Argo CD
231231

232232
1. Without `imagePullSecrets`:
233233
```bash
234-
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"
234+
helm install devtron <devtron-chart-file> --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-string components.devtron.customOverrides.IS_AIR_GAP_ENVIRONMENT=true
235235
```
236236

237237
2. With `imagePullSecrets`:
238238
```bash
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
239+
helm install devtron <devtron-chart-file> --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 --set-string components.devtron.customOverrides.IS_AIR_GAP_ENVIRONMENT=true
240240
```
241241

242242
---

docs/setup/install/installation-configuration.md

+120-1
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,11 @@ Use the following command to configure AWS S3 bucket for storing build logs and
149149

150150
* **Configure using S3 IAM policy:**
151151

152-
>NOTE: Pleasee ensure that S3 permission policy to the IAM role attached to the nodes of the cluster if you are using the below command.
152+
>NOTE: Please ensure that S3 permission policy to the IAM role attached to the nodes of the cluster if you are using the below command.
153153
154154
```bash
155155
helm repo update
156+
156157
helm upgrade devtron devtron/devtron-operator --namespace devtroncd \
157158
--reuse-values \
158159
--set installer.modules={cicd} \
@@ -234,9 +235,127 @@ helm upgrade devtron devtron/devtron-operator --namespace devtroncd \
234235
--set configs.DEFAULT_BUILD_LOGS_BUCKET=log-bucket
235236
```
236237

238+
{% endtab %}
239+
240+
{% tab title="S3-compatible Storage" %}
241+
Use the following command to configure S3-compatible storage (e.g., Longhorn) for storing build logs and cache.
242+
243+
```bash
244+
helm repo update
245+
246+
helm upgrade devtron devtron/devtron-operator --namespace devtroncd \
247+
--reuse-values \
248+
--set configs.BLOB_STORAGE_PROVIDER=S3 \
249+
--set configs.DEFAULT_CACHE_BUCKET=demo-s3-bucket \
250+
--set configs.DEFAULT_CACHE_BUCKET_REGION=us-east-1 \
251+
--set configs.DEFAULT_BUILD_LOGS_BUCKET=demo-s3-bucket \
252+
--set configs.DEFAULT_CD_LOGS_BUCKET_REGION=us-east-1 \
253+
--set secrets.BLOB_STORAGE_S3_ACCESS_KEY=<access-key> \
254+
--set secrets.BLOB_STORAGE_S3_SECRET_KEY=<secret-key> \
255+
--set configs.BLOB_STORAGE_S3_ENDPOINT=<endpoint>
256+
```
257+
237258
{% endtab %}
238259
{% endtabs %}
239260

261+
---
262+
263+
## Configuring NodeSelectors and Tolerations
264+
265+
### Adding Custom Configurations
266+
267+
When installing Devtron, you can specify `nodeSelectors` and `tolerations` to fine-tune your deployment. These configurations can be added using either additional `--set` flags or a separate `values.yaml` file.
268+
269+
### Global vs. Component-level Configurations
270+
271+
* **Global Configurations**: When specified at the global level, these settings apply to all Devtron microservices, except for ArgoCD.
272+
* **Component-Level Configurations**: You can also apply these settings to specific components individually.
273+
* **Priority**: If a configuration is specified at both the global and component levels, the component-level setting takes precedence for that particular component.
274+
275+
### Using `--set` Flags
276+
277+
You can use the `--set` flag to specify individual values directly in the Helm command.
278+
279+
280+
1. **nodeSelector**
281+
282+
To set a nodeSelector:
283+
284+
```bash
285+
helm install devtron devtron/devtron-operator \
286+
--create-namespace --namespace devtroncd \
287+
--set global.nodeSelector."kubernetes\.io/hostname"=node1
288+
```
289+
290+
This example sets the nodeSelector to schedule pods on a node with the hostname "node1".
291+
292+
293+
2. **Tolerations**
294+
295+
To set tolerations:
296+
297+
```bash
298+
helm install devtron devtron/devtron-operator \
299+
--create-namespace --namespace devtroncd \
300+
--set global.tolerations[0].key=example-key \
301+
--set global.tolerations[0].operator=Exists \
302+
--set global.tolerations[0].effect=NoSchedule \
303+
--set global.tolerations[0].value=value1
304+
```
305+
306+
This example adds a tolerance for pods to be scheduled on nodes with the taint "example-key".
307+
308+
309+
### Using `values.yaml`
310+
311+
In the values.yaml file of devtron chart, set the values of the following fields:
312+
313+
```yaml
314+
global:
315+
nodeSelector:
316+
kubernetes.io/hostname: node1 # For nodeSelector
317+
tolerations:
318+
- key: example-key # For tolerations
319+
operator: Exists
320+
value: "value1"
321+
effect: NoSchedule
322+
```
323+
324+
---
325+
326+
## Set StorageClass for Devtron Microservices
327+
328+
You can specify a StorageClass to be used by Devtron microservices' Persistent Volume Claims (PVCs) if a default StorageClass is not already configured in your cluster.
329+
330+
### Checking for a Default StorageClass
331+
332+
To check if your cluster has a default StorageClass, run:
333+
334+
```bash
335+
kubectl get sc
336+
```
337+
338+
This command will list all available StorageClasses in your cluster, including the default storage class set (if any). The default StorageClass (if any) can be identified by the (default) label next to its name.
339+
340+
### Setting a Default StorageClass
341+
342+
If no StorageClass class is set as default, you can set one using the following command:
343+
344+
```bash
345+
kubectl patch storageclass <storageclassname> -p '{"metadata": {"annotations":{"storageclass.kubernetes.io/is-default-class":"true"}}}
346+
```
347+
348+
Or, if you do not want to change the default StorageClass or prefer to use a different StorageClass for Devtron microservices, specify it during installation using the `--set` flag:
349+
350+
```bash
351+
helm install devtron devtron/devtron-operator \
352+
--create-namespace --namespace devtroncd \
353+
--set global.storageClass="<storageclassname>" # set your preferred StorageClass
354+
```
355+
356+
Alternatively, you can specify the StorageClass in the values.yaml file by modifying the [following line in values.yaml](https://github.com/devtron-labs/devtron/blob/main/charts/devtron/values.yaml#L23).
357+
358+
---
240359
241360
## Secrets
242361
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,118 @@
11
# Google
22

3-
## Sample Configuration
3+
## Introduction
44

5-
![](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/sso-login-service/google.jpg)
5+
Integrating Google as your Single Sign-On (SSO) provider enables users to authenticate with their Google accounts, ensuring secure and streamlined access to Devtron. This document walks you through setting up Google SSO in Devtron, ensuring users can log in smoothly.
66

7-
---
7+
## Prerequisites
88

9-
## Values You Would Require at SSO Provider
9+
To configure Google SSO in Devtron, you will need:
1010

11-
Devtron provides a sample configuration out of the box. There are some values that you need to either get from your SSO provider or give to your SSO provider.
11+
* Super Admin permissions
12+
* Only a [Super-Admin](https://docs.devtron.ai/global-configurations/authorization/user-access) can configure SSO. If you are setting up SSO for the first time, use [Admin Credentials](https://docs.devtron.ai/install/install-devtron#devtron-admin-credentials) instead.
13+
* A Google Cloud account to create and manage OAuth credentials. If you don’t have one, you must create it at the [Google Cloud Console](https://console.cloud.google.com/).
1214

13-
### Values to Fetch
15+
## Get the Redirect URI from Devtron
1416

15-
* clientID
17+
Before configuring Google as an SSO provider,
18+
* Ensure that the [Host URL](../../host-url.md) is correctly configured in Devtron. This is crucial because the Redirect URI is generated based on the Host URL.
19+
* You need to retrieve the Redirect URI from Devtron, which will be required in Google Cloud while setting up OAuth credentials.
1620

17-
* clientSecret
21+
* Log in to Devtron.
22+
* Navigate to **Global Configurations****SSO Login Services**.
23+
* Select **Google** as the authentication provider.
24+
* Enter the Host URL in the `URL` field. (This is essential to generate the correct Redirect URI.)
25+
* Copy the Redirect URI displayed in this section. You will need to enter this in Google Cloud.
1826

19-
![Fetching Client ID and Secret](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/sso-login-service/secret/google-id-secret.jpg)
27+
![Figure 1: Get the Redirect URI](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/sso-login-service/redirect-uri-google-sso.jpg)
2028

29+
## Configure OAuth in Google Cloud Console
2130

22-
### Values to Provide
31+
The next step is to configure OAuth credentials in Google Cloud Console. This involves creating a Google OAuth Client ID and Client Secret, which will be used in Devtron for authentication.
2332

24-
* redirectURI (provided in SSO Login Services by Devtron)
33+
### To set up OAuth, follow these steps:
2534

26-
![Copying Redirect URI from Devtron](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/sso-login-service/redirect/google-redurl.jpg)
35+
* Access [Google Cloud Console](https://console.cloud.google.com/) and create a new project or select an existing one.
36+
* Navigate to **APIs & Services****OAuth Consent Screen** and configure the required details as shown on the screen.
37+
* In **APIs & Services****Credentials**, create a new OAuth Client ID:
38+
* Select 'Web application' as the application type.
39+
* Paste the Redirect URI (copied from Devtron) under Authorized Redirect URIs.
40+
* Click **Create** to generate the Client ID and Client Secret.
2741

28-
![Pasting Redirect URI](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/sso-login-service/redirect/google-redirect.jpg)
42+
{% hint style="warning" %}
43+
Google SSO Requires a Valid Domain with HTTPS
2944

30-
---
45+
Google does not support IP addresses as valid redirect URIs. You must use a valid domain name ([FQDN](https://en.wikipedia.org/wiki/Fully_qualified_domain_name)) accessible over HTTPS.
3146

32-
## Reference
47+
Examples of valid URIs:
3348

34-
* [View Google Documentation](https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid)
49+
https://devtron.example.com/api/dex/callback
50+
51+
https://auth.yourcompany.com/callback
52+
53+
Examples of invalid URIs:
54+
55+
http://localhost:8080/callback
56+
57+
http://192.168.1.10/callback
58+
{% endhint %}
59+
60+
![Figure 2a: Creating OAuth Client](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/sso-login-service/creating-oauth-client-google-sso.jpg)
61+
62+
You can see a new client ID is created in the **APIs & Services****Credentials**, under **OAuth 2.0 Client IDs** section. To obtain Client ID and Client Secret, click on the name (devtron-sso in our case) of the **OAuth 2.0 Client IDs**
63+
64+
![Figure 2b: Client ID Created](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/sso-login-service/client-id-created-google-sso.jpg)
65+
66+
Copy the Client ID and Client Secret, as they will be required in Devtron’s SSO configuration.
67+
68+
![Figure 2c: Get the Client ID and Client Secret](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/sso-login-service/client-id-and-secret-google-sso.jpg)
69+
70+
For a detailed step-by-step guide, refer to Google’s official documentation: [Get Google API Client ID](https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid).
71+
72+
## Configure Google SSO in Devtron
73+
74+
The next step is to configure Devtron to use these credentials for authentication. For this, navigate back to **Global Configurations → SSO Login Services**, here you can already find a configuration template.
3575

36-
* [View Dex IdP Documentation](https://dexidp.io/docs/connectors/google/)
76+
## Configuration
3777

78+
![Figure 3: Configuring SSO in Devtron](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/sso-login-service/configuration-devtron-google-sso.jpg)
3879

80+
In the configuration,&#x20;
3981

82+
* Enter the OAuth Credentials:
83+
* Paste the Client ID obtained from Google Cloud in the `clientID` field.
84+
* Paste the Client Secret obtained from Google Cloud in the `clientSecret` field.
85+
* Configure Hosted Domains (Optional):
86+
* If you want to restrict authentication to specific domains (e.g., only users from company.com can log in), add these under `hostedDomains` in Devtron.
87+
* If you want to allow all users with any valid Google account, remove the entire `hostedDomains` section from the configuration.
88+
* Enter the Redirect URI:
89+
* Copy the Redirect URI displayed in Devtron and paste the value in the `redirectURI` field.
90+
* Click **Update** to save the configuration, once saved, Google SSO is successfully configured
91+
92+
{% hint style="warning" %}
93+
Although Google SSO is now set up, users will not be able to sign in unless they are explicitly added to Devtron with the necessary permissions.
94+
{% endhint %}
95+
96+
## Important: Enable User Access After SSO Setup
97+
98+
To ensure users can log in:
99+
100+
* Go to **Global Configurations****Authorization****User Permissions**.
101+
* Click **Add User**.
102+
103+
![Figure 4a: Configuring User Permissions](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/sso-login-service/config-user-permissions-google-sso.jpg)
104+
105+
* Enter their email (matching their Google account).
106+
* Assign the required role.
107+
* Click **Save** to complete the setup.
108+
109+
![Figure 4b: Adding User with required permissions](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/global-configurations/sso-login-service/adding-user-google-sso.jpg)
110+
111+
Once saved, Devtron will use Google OAuth for authentication, allowing users to log in using their Google accounts.
112+
113+
For detailed steps on managing user permissions, refer to the [User Permissions Documentation](../user-access.md).
114+
115+
## Reference
116+
117+
* [View Google Documentation](https://developers.google.com/identity/gsi/web/guides/get-google-api-clientid)
118+
* [View Dex IdP Documentation](https://dexidp.io/docs/connectors/google/)

0 commit comments

Comments
 (0)