Skip to content

docs: added Deployment and migrate via FluxCD #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6ff7f59
docs: add flux deploment
Hii-Arpit Jul 4, 2025
91a8442
docs: enable FluxCD integration
Hii-Arpit Jul 8, 2025
487ea7a
docs: added migrate FluxCD
Hii-Arpit Jul 8, 2025
47211e2
docs: technical fixes
Hii-Arpit Jul 8, 2025
f0c7877
docs: content fixed
Hii-Arpit Jul 9, 2025
d4441b8
docs: optimised for OSS and enteprise
Hii-Arpit Jul 10, 2025
bb52f84
docs: added figure and captions
Hii-Arpit Jul 10, 2025
71d947a
docs: fixes
Hii-Arpit Jul 10, 2025
54cb50a
docs: optimised for gitbook
Hii-Arpit Jul 10, 2025
89b8444
docs: added enterprise tagging
Hii-Arpit Jul 10, 2025
0cb055e
docs: added rbac
Hii-Arpit Jul 10, 2025
589282b
docs: gitbook optimizations
Hii-Arpit Jul 10, 2025
559de95
docs: minor fixes
Hii-Arpit Jul 11, 2025
e9b2fde
docs: minor fixes
Hii-Arpit Jul 11, 2025
b5b6d0f
Merge branch 'main' of https://github.com/Hii-Arpit/devtron-documenta…
Hii-Arpit Jul 14, 2025
5146e1e
docs: implemented suggestions
Hii-Arpit Jul 15, 2025
ba8bc05
docs: implement suggestions v2
Hii-Arpit Jul 16, 2025
33e1429
docs: added images and captions
Hii-Arpit Jul 16, 2025
38c1b63
Merge branch 'main' of https://github.com/Hii-Arpit/devtron-documenta…
Hii-Arpit Jul 16, 2025
1f2d056
docs
Hii-Arpit Jul 16, 2025
a7724c0
docs: optimizations for gitbook
Hii-Arpit Jul 16, 2025
faed4e6
docs: update summary.md
Hii-Arpit Jul 16, 2025
eb76c17
docs: fixes
Hii-Arpit Jul 16, 2025
5a57f33
docs: implmented requested changes
Hii-Arpit Jul 21, 2025
f2f9d69
docs: minor fixes
Hii-Arpit Jul 21, 2025
2faafc4
docs: minor fixes
Hii-Arpit Jul 21, 2025
adf35ed
docs: fixes links
Hii-Arpit Jul 21, 2025
aff6404
docs: fix
Hii-Arpit Jul 21, 2025
f51050f
docs: fix
Hii-Arpit Jul 21, 2025
96ed694
docs: fix
Hii-Arpit Jul 21, 2025
fd78aef
docs: fix
Hii-Arpit Jul 21, 2025
bca98a7
docs: fix
Hii-Arpit Jul 21, 2025
aaffed5
docs: fix
Hii-Arpit Jul 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@
* [Terraform CLI](user-guide/plugins/terraform-cli.md)
* [Vulnerability Scanning](user-guide/plugins/vulnerability-scanning.md)
* [Using Devtron Intelligence](user-guide/devtron-intelligence.md)
* [Enable GitOps Deployments with FluxCD](user-guide/creating-application/fluxcd.md)

## Resources

Expand Down
169 changes: 169 additions & 0 deletions docs/user-guide/creating-application/fluxcd.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# Enable GitOps Deployments with FluxCD

{% hint style="info" %}
### Prerequisite

Make sure to install:

1. [Build and Deploy (CI/CD) integration](../integrations/build-and-deploy-ci-cd.md)

2. [GitOps (ArgoCD) integration](../integrations/argocd.md)

{% endhint %}

Devtron supports FluxCD to enable GitOps-based deployments. With FluxCD, you can:

* Deploy applications via GitOps (via FluxCD).

* Deploy Helm charts via FluxCD.

* Migrate existing FluxCD applications into Devtron.

Your Git repository becomes the single source of truth for your Kubernetes workloads. Any changes you make in Git are automatically applied to your Kubernetes cluster by FluxCD. Refer to the [FluxCD documentation](https://fluxcd.io/flux/) to learn more.


## Installation

{% hint style="warning" %}
### Who Can Perform This Action?
The user must have permissions to:
* Edit the ConfigMaps of 'default-cluster'
* Restart the pods
{% endhint %}

To enable deployments through GitOps via FluxCD, you need to enable a specific feature flag for the `default_cluster` in Devtron.

|Feature|Flag|Description|
|:---|:---|:---|
|**Deployments via FluxCD**|`FEATURE_FLUX_DEPLOYMENTS_ENABLE: "true"`|This flag will enable deployments through GitOps via FluxCD.<ul><li> After enabling this flag, you also need to install FluxCD controller in order to deploy applications successfully. Refer [Installing FluxCD Controller](#installing-fluxcd-controller-only-for-deployments) to know more.</li></ul>|
|**Migrating existing FluxCD applications**|`FEATURE_LINK_EXTERNAL_FLUX_ENABLE: "true"`|This flag will enable migrations for external FluxCD apps into Devtron.|

{% hint style="warning" %}
### Deployment Strategies for FluxCD Deployments

Application deployments through GitOps (via FluxCD) are supported only when using the `Deployment` or `Rollout` deployment strategies with the latest chart versions. Other deployment strategies are currently not supported.
{% endhint %}

### Enabling Feature Flags

1. Navigate to Devtron's **Resource Browser**.

![Figure 1: Navigating to Resource Browser](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/fluxcd/fluxcd-resource-browser.jpg)

2. Select the `default_cluster` to enable the feature flags.

![Figure 2: Selecting 'default_cluster'](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/fluxcd/fluxcd-select-cluster.jpg)

3. Go to Config & Storage → ConfigMap, and click `dashboard-cm` ConfigMap

![Figure 3: Clicking 'dashboard-cm'](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/fluxcd/fluxcd-select-dashboard-cm.jpg)

4. Edit the `dashboard-cm` ConfigMap by clicking **Edit live manifest**.

![Figure 4: Editing Live Manifest](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/fluxcd/fluxcd-edit-live-manifest.jpg)
1. To enable deployments via FluxCD, check if the below entries are present in the ConfigMap (create one if it doesn't exist) and select **Apply changes**.<br>

```yaml
FEATURE_FLUX_DEPLOYMENTS_ENABLE: "true"
```

2. To enable migration for external FluxCD applications, check if the below entries are present in the ConfigMap (create one if it doesn't exist) and select **Apply changes**.<br>

```yaml
FEATURE_LINK_EXTERNAL_FLUX_ENABLE: "true"
```

<br>

![Figure 5: Adding Feature Flags](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/fluxcd/fluxcd-add-flags.jpg)

5. Restart the deployment:
1. **For OSS Users:**
1. Navigate to Devtron's Resource Browser.

2. Select the cluster for which you have enabled the feature flags.

3. Click the **Terminal** tab.

4. Restart the deployment using the following command:

```yaml
kubectl rollout restart deployment dashboard -n devtroncd
```

![Figure 6: Restarting Deployment](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/fluxcd/fluxcd-restart-deployment.gif)
2. **For Enterprise Users:**
1. Go to **Resource Browser** → (select the cluster in which you have enabled the feature flags) → **Workloads** → **Deployment**

2. Click the checkbox next to the `dashboard` Deployment workloads and restart them using the `⟳` button.

![Figure 7: Restart 'dashboard' deployment workloads](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/kubernetes-resource-browser/devtron-intelligence/restart-deployments.jpg)

6. Perform a hard refresh of the browser to clear the cache:

* **Mac**: Hold down Cmd and Shift and then press R.

* **Windows/Linux**: Hold down Ctrl and then press F5.

### Installing FluxCD Controller (Only for Deployments)

After enabling the feature flag for deployments, the next step is to install FluxCD Controller in every cluster (including the default cluster) in which you want to deploy the FluxCD applications.

You can install FluxCD Controller by any of the following ways:

1. [Install FluxCD controller via Cluster Terminal](#install-fluxcd-controller-via-cluster-terminal) (Recommended)

2. [Install FluxCD controller via Chart Store](#install-fluxcd-controller-via-chart-store)


#### Install FluxCD controller via Cluster Terminal.

1. Navigate to Devtron's Resource Browser.

2. Select the cluster for which you have enabled the feature flags.

3. Click the **Terminal** tab.

4. Run the following command to install the FluxCD Controller:

```yaml
kubectl apply -f https://github.com/fluxcd/flux2/releases/download/v0.35.0/install.yaml
```

![Figure 8: Installing FluxCD Controller](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/fluxcd/fluxcd-install-controller.gif)

5. After the command is executed successfully, you can deploy or migrate your applications in that cluster through GitOps (via FluxCD).

#### Install FluxCD controller via Chart Store.

To install FluxCD controller via Chart Store, follow the below steps.

1. Add FluxCD controller repository, `https://fluxcd-community.github.io/helm-charts` in the chart repositories (if not already added) in Global Configurations. Refer [Chart Repositories](../global-configurations/chart-repo.md#add-chart-repository) to learn more.

![Figure 9: Adding FluxCD Chart Repository](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/fluxcd/fluxcd-add-chart-repo.gif)

2. Add a new environment in the cluster in which you want to deploy the application via FluxCD linked to namespace as `flux-system`. Refer [Clusters and Environments](../global-configurations/cluster-and-environments.md#add-environment-to-a-cluster) to lean more.

![Figure 10: Adding Environment linked to 'flux-system' namespace](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/fluxcd/fluxcd-add-env.gif)

3. Navigate to **Chart Store** and select the `flux2` chart.

![Figure 11: Selecting 'flux2' Chart](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/fluxcd/fluxcd-flux2.jpg)

4. Click **Configure and Deploy**.

![Figure 12: Deploying 'flux2' Chart](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/fluxcd/fluxcd-deploy-chart.jpg)

5. Configure the following configurations:

|Field Name|Description|
|:---|:---|
|**App Name**|Define a name for the chart.|
|**Project**|Select a project from the dropdown|
|**Deploy to Environment**|Select the environment which you have created in your preferred cluster linked to `flux-system` namespace.|

![Figure 13: Configuring 'flux2' Chart](https://devtron-public-asset.s3.us-east-2.amazonaws.com/images/creating-application/fluxcd/fluxcd-chart-config.jpg)

6. Click **Deploy** and the chart will be deployed.

After the chart is successfully deployed, you can deploy applications though GitOps (via FluxCD).
Loading