Skip to content

Commit 131d16f

Browse files
authored
doc: Added User-defined Git Repo (#4895)
* Added a doc on User-defined Git Repo * Added GitOps for Helm Apps * Added feature flag * Added steps and gif for adding feature flag * Elaborated the exact cluster, namespace, and CM
1 parent 8cd553a commit 131d16f

File tree

6 files changed

+268
-86
lines changed

6 files changed

+268
-86
lines changed

docs/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
* [Rollout Deployment](user-guide/creating-application/deployment-template/rollout-deployment.md)
7171
* [Job and Cronjob](user-guide/creating-application/deployment-template/job-and-cronjob.md)
7272
* [StatefulSets](user-guide/creating-application/deployment-template/statefulset.md)
73+
* [GitOps Configuration](user-guide/creating-application/gitops-config.md)
7374
* [Workflow Editor](user-guide/creating-application/workflow/README.md)
7475
* [CI Pipeline](user-guide/creating-application/workflow/ci-pipeline.md)
7576
* [Pre-Build/Post-Build Stages](user-guide/creating-application/workflow/ci-build-pre-post-plugins.md)

docs/user-guide/cloning-application.md

+4
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@ Now click on `Clone App` to clone the selected application.
2121

2222
New application with a duplicate template is created.
2323

24+
{% hint style="warning" %}
25+
When cloning an application with GitOps configuration, the configuration itself is not copied. To set up the configuration for your new application, refer [GitOps Configuration](./creating-application/gitops-config.md) guide.
26+
{% endhint %}
27+

docs/user-guide/creating-application/README.md

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
[Base Deployment Template](deployment-template.md)
1414

15+
[GitOps Configuration](gitops-config.md)
16+
1517
[Workflow Editor](workflow/README.md)
1618

1719
[ConfigMaps](config-maps.md)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# GitOps Configuration
2+
3+
{% hint style="warning" %}
4+
The 'GitOps Configuration' page appears only if the super-admin has enabled 'Allow changing git repository for application' in [Global Configurations → GitOps](../global-configurations/gitops.md).
5+
{% endhint %}
6+
7+
## Introduction
8+
9+
This configuration is an extension of the [GitOps](../global-configurations/gitops.md) settings present in [Global Configurations](../global-configurations/README.md) of Devtron. Therefore, make sure you read it before making any changes to your app configuration.
10+
11+
The application-level GitOps configuration offers the flexibility to add a custom Git repo (as opposed to Devtron auto-creating a repo for your application).
12+
13+
---
14+
15+
## Adding Custom Git Repo for GitOps
16+
17+
{% hint style="warning" %}
18+
### Who Can Perform This Action?
19+
Users need to have [Admin permission](../../user-guide/global-configurations/authorization/user-access.md#role-based-access-levels) or above (along with access to the environment and application) to configure user-defined Git repo.
20+
{% endhint %}
21+
22+
### For Devtron Apps
23+
24+
1. Go to **Applications****Devtron Apps** (tab) → (choose your app) → **App Configuration** (tab) → **GitOps Configuration**.
25+
26+
![Figure 1: App-level GitOps Config](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/gitops/app-config-gitops.jpg)
27+
28+
2. Assuming a GitOps repo was not added to your application earlier, you get 2 options:
29+
30+
* **Auto-create repository** - Select this option if you wish to proceed with the default behavior. It will create a repository automatically, named after your application with a prefix. Thus saving you the trouble of creating one manually.
31+
32+
* **Commit manifests to a desired repository** - Select this option if you wish to add a custom repo that is already created with your [Git provider](../global-configurations/gitops.md#supported-git-providers). Enter its link in the `Git Repo URL` field.
33+
34+
![Figure 2: Repo Creation](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/gitops/gitops-config.jpg)
35+
36+
37+
{% hint style="warning" %}
38+
GitOps repositories, whether auto-created by Devtron or added manually, are immutable. This means they cannot be modified after creation. The same is true if you have an existing CD pipeline that uses/used GitOps for deployment.
39+
{% endhint %}
40+
41+
3. Click **Save**.
42+
43+
![Figure 3: Saved GitOps Config](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/gitops/saved-config.jpg)
44+
45+
**Note**: In case you skipped the GitOps configuration for your application and proceeded towards the [creation of a new CD pipeline](../creating-application/workflow/cd-pipeline.md#creating-cd-pipeline)(that uses GitOps), you will be prompted to configure GitOps as shown below:
46+
47+
![Figure 4: Incomplete GitOps Config](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/gitops/gitops-not-configured.jpg)
48+
49+
50+
### For Helm Apps
51+
52+
You can [deploy a helm chart](../deploy-chart/overview-of-charts.md#deploying-chart) using either Helm or GitOps. Let's assume you wish to deploy `airflow` chart.
53+
54+
1. Select the helm chart from the [Chart Store](../deploy-chart/README.md).
55+
56+
![Figure 5: Choosing a Helm Chart](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/gitops/chart-selection.jpg)
57+
58+
2. Click **Configure & Deploy**.
59+
60+
![Figure 6: Configure & Deploy Button](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/gitops/configure-deploy.jpg)
61+
62+
3. After you enter the `App Name`, `Project`, and `Environment`; an option to choose the deployment approach (i.e., Helm or GitOps) would appear.
63+
64+
![Figure 7: Deployment Approach](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/gitops/deployment-method.jpg)
65+
66+
4. Select **GitOps**.
67+
68+
![Figure 8: Selecting GitOps Method](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/gitops/select-gitops.jpg)
69+
70+
5. A modal window will appear for you to enter a Git repository. Just like [Devtron Apps](#for-devtron-apps) (step 2), you get two options:
71+
* Auto-create repository
72+
* Commit manifests to a desired repository
73+
74+
![Figure 9: Adding a Repo](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/gitops/git-repository-helm-app.jpg)
75+
76+
6. Enter your custom Git Repo URL, and click **Save**.
77+
78+
![Figure 10: Saved GitOps Config for Helm App](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/gitops/custom-git-repo-helm-apps.jpg)
79+
80+
Next, you may proceed to deploy the chart.
81+
82+
{% hint style="warning" %}
83+
Once you deploy a helm app with GitOps, you cannot change its GitOps repo.
84+
{% endhint %}

docs/user-guide/creating-application/workflow/cd-pipeline.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Click the '**+**' sign on CI Pipeline to attach a CD Pipeline to it.
1010

1111
A basic `Create deployment pipeline` window will pop up.
1212

13-
![Figure 1b: Creating CD Pipeline](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/workflow-cd-pipeline/ca-workflow-basic-v2.jpg)
13+
![Figure 1b: Creating CD Pipeline](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/workflow-cd-pipeline/cd-workflow-basic-v3.jpg)
1414

1515
Here, you get three sections:
1616

@@ -20,13 +20,14 @@ Here, you get three sections:
2020

2121
### Deploy to Environment
2222

23-
This section expects three inputs from you:
23+
This section expects four inputs from you:
2424

2525
| Setting | Description | Options |
2626
| ----------- | ---------------------------------------------------------- | ------------------------- |
2727
| Environment | Select the environment where you want to deploy your application | (List of available environments) |
2828
| Namespace | Automatically populated based on the selected environment | Not Applicable |
2929
| Trigger | When to execute the deployment pipeline | **Automatic**: Deployment triggers automatically when a new image completes the previous stage (build pipeline or another deployment pipeline) <br /> **Manual**: Deployment is not initiated automatically. You can trigger deployment with a desired image. |
30+
| Deployment Approach | How to deploy the application | **Helm** or **GitOps** <br /> Refer [GitOps](../../global-configurations/gitops.md) |
3031

3132
### Deployment Strategy
3233

0 commit comments

Comments
 (0)