|
| 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 | +  |
| 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 | +  |
| 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 | +  |
| 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 | + |
| 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 | +  |
| 57 | + |
| 58 | +2. Click **Configure & Deploy**. |
| 59 | + |
| 60 | +  |
| 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 | +  |
| 65 | + |
| 66 | +4. Select **GitOps**. |
| 67 | + |
| 68 | +  |
| 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 | +  |
| 75 | + |
| 76 | +6. Enter your custom Git Repo URL, and click **Save**. |
| 77 | + |
| 78 | +  |
| 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 %} |
0 commit comments