-
Notifications
You must be signed in to change notification settings - Fork 3
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
Hii-Arpit
wants to merge
33
commits into
devtron-labs:main
Choose a base branch
from
Hii-Arpit:deploy-flux
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+250
−16
Open
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 91a8442
docs: enable FluxCD integration
Hii-Arpit 487ea7a
docs: added migrate FluxCD
Hii-Arpit 47211e2
docs: technical fixes
Hii-Arpit f0c7877
docs: content fixed
Hii-Arpit d4441b8
docs: optimised for OSS and enteprise
Hii-Arpit bb52f84
docs: added figure and captions
Hii-Arpit 71d947a
docs: fixes
Hii-Arpit 54cb50a
docs: optimised for gitbook
Hii-Arpit 89b8444
docs: added enterprise tagging
Hii-Arpit 0cb055e
docs: added rbac
Hii-Arpit 589282b
docs: gitbook optimizations
Hii-Arpit 559de95
docs: minor fixes
Hii-Arpit e9b2fde
docs: minor fixes
Hii-Arpit b5b6d0f
Merge branch 'main' of https://github.com/Hii-Arpit/devtron-documenta…
Hii-Arpit 5146e1e
docs: implemented suggestions
Hii-Arpit ba8bc05
docs: implement suggestions v2
Hii-Arpit 33e1429
docs: added images and captions
Hii-Arpit 38c1b63
Merge branch 'main' of https://github.com/Hii-Arpit/devtron-documenta…
Hii-Arpit 1f2d056
docs
Hii-Arpit a7724c0
docs: optimizations for gitbook
Hii-Arpit faed4e6
docs: update summary.md
Hii-Arpit eb76c17
docs: fixes
Hii-Arpit 5a57f33
docs: implmented requested changes
Hii-Arpit f2f9d69
docs: minor fixes
Hii-Arpit 2faafc4
docs: minor fixes
Hii-Arpit adf35ed
docs: fixes links
Hii-Arpit aff6404
docs: fix
Hii-Arpit f51050f
docs: fix
Hii-Arpit 96ed694
docs: fix
Hii-Arpit fd78aef
docs: fix
Hii-Arpit bca98a7
docs: fix
Hii-Arpit aaffed5
docs: fix
Hii-Arpit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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**. | ||
|
||
 | ||
|
||
2. Select the `default_cluster` to enable the feature flags. | ||
|
||
 | ||
|
||
3. Go to Config & Storage → ConfigMap, and click `dashboard-cm` ConfigMap | ||
|
||
 | ||
|
||
4. Edit the `dashboard-cm` ConfigMap by clicking **Edit live manifest**. | ||
|
||
 | ||
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> | ||
|
||
 | ||
|
||
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 | ||
Hii-Arpit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
 | ||
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. | ||
|
||
 | ||
|
||
Hii-Arpit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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. | ||
Hii-Arpit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
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 | ||
``` | ||
|
||
 | ||
|
||
5. After the command is executed successfully, you can deploy or migrate your applications in that cluster through GitOps (via FluxCD). | ||
Hii-Arpit marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
#### 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. | ||
|
||
 | ||
|
||
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. | ||
|
||
 | ||
|
||
3. Navigate to **Chart Store** and select the `flux2` chart. | ||
|
||
 | ||
|
||
4. Click **Configure and Deploy**. | ||
|
||
 | ||
|
||
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.| | ||
|
||
 | ||
|
||
6. Click **Deploy** and the chart will be deployed. | ||
|
||
After the chart is successfully deployed, you can deploy applications though GitOps (via FluxCD). |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.