Enable GitOps Deployments with FluxCD
Prerequisite
Please make sure to install
Build and Deploy (CI/CD) integration. To install it, click here.
GitOps (ArgoCD) integration. To install it, click here.
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 to learn more.
Installation
Who Can Perform This Action?
The user must have permissions to:
Edit the ConfigMaps of 'default-cluster'
Restart the pods
To enable deployments through GitOps via FluxCD, you need to enable a specific feature flag for the default_cluster
in Devtron.
Deployments via FluxCD
FEATURE_FLUX_DEPLOYMENTS_ENABLE: " true"
This Flag will enable deployments through GitOps via FluxCD.
After enabling this flag, you also need to install FluxCD controller in order to deploy applications successfully. Refer Installing FluxCD Controller to know more.
Migrating existing FluxCD applications
FEATURE_LINK_EXTERNAL_FLUX_ENABLE: "true"
This Flag will enable migrations for external FluxCD apps into Devtron.
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.
Enabling Feature Flags
Navigate to Devtron Resource Browser.
Figure 1: Navigating to Resource Browser Select the
default_cluster
to enable the feature flags.Figure 2: Selecting 'default_cluster' Go to Config & Storage → ConfigMap, and select
dashboard-cm
ConfigMapFigure 3: Selecting 'dashboard-cm' Edit the
dashboard-cm
ConfigMap by clicking Edit live manifest.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.
FEATURE_FLUX_DEPLOYMENTS_ENABLE: " true"
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.
FEATURE_LINK_EXTERNAL_FLUX_ENABLE: "true"
Figure 4: Editing Live Manifest Figure 5: Adding Feature Flags Restart the deployment:
For OSS Users:
Navigate to Devtron Resource Browser.
Select the cluster for which you have enabled the feature flags.
Click the Terminal tab.
Restart the deployment using the following command:
kubectl rollout restart deployment dashboard -n devtroncd
Figure 6: Restarting Deployment
For Enterprise Users:
Go to Resource Browser → (Select Cluster in which you have enabled the feature flags) → Workloads → Deployment
Click the checkbox next to the
dashboard
Deployment workloads and restart them using the ⟳ button.Figure 7: Restart 'dashboard' deployment workloads
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 via two ways:
Install FluxCD controller via Cluster Terminal.
Install FluxCD controller via Chart Store.
Install FluxCD controller via Cluster Terminal.
Navigate to Devtron Resource Browser.
Select the cluster for which you have enabled the feature flags.
Click the Terminal tab.
Run the following command to install the FluxCD Controller:
kubectl apply -f https://github.com/fluxcd/flux2/releases/download/v0.35.0/install.yaml

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.
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 to learn more.Figure 9: Adding FluxCD Chart Repository 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 to lean more.Figure 10: Adding Environment linked to 'flux-system' namespace Navigate to Chart Store and select the
flux2
chart.Figure 11: Selecting 'flux2' Chart Click Configure and Deploy.
Figure 12: Deploying 'flux2' Chart Configure the following configurations:
Field NameDescriptionApp 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 Click Deploy and the chart will be deployed.
After the chart is successfully deployed, you can deploy applications though GitOps (via FluxCD).