From 53163313b3256dfe5ede65e55ac72273f7a4cab2 Mon Sep 17 00:00:00 2001 From: "Kostis (Codefresh)" <39800303+kostis-codefresh@users.noreply.github.com> Date: Tue, 2 Apr 2024 19:07:58 +0200 Subject: [PATCH] docs: clarify multiple sources example (#17698) Signed-off-by: Kostis (Codefresh) <39800303+kostis-codefresh@users.noreply.github.com> Signed-off-by: Boyan Kirov --- docs/user-guide/multiple_sources.md | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/docs/user-guide/multiple_sources.md b/docs/user-guide/multiple_sources.md index e539f8f6288aa..be8f8852e609f 100644 --- a/docs/user-guide/multiple_sources.md +++ b/docs/user-guide/multiple_sources.md @@ -5,6 +5,9 @@ the first source is specified. Full UI/CLI support will be added in a future release. This feature is subject to change in backwards incompatible ways until it is marked stable. +By default an Argo CD application is a link between a single source and a cluster. Sometimes however, you want to combine +files from multiple locations to form a single Application. + Argo CD has the ability to specify multiple sources for a single Application. Argo CD compiles all the sources and reconciles the combined resources. @@ -17,7 +20,7 @@ See the below example for specifying multiple sources: apiVersion: argoproj.io/v1alpha1 kind: Application metadata: - name: guestbook + name: my-billing-app namespace: argocd spec: project: default @@ -25,19 +28,19 @@ spec: server: https://kubernetes.default.svc namespace: default sources: - - chart: elasticsearch - repoURL: https://helm.elastic.co + - repoURL: https://github.com/mycompany/billing-app.git + path: manifests targetRevision: 8.5.1 - - repoURL: https://github.com/argoproj/argocd-example-apps.git - path: guestbook + - repoURL: https://github.com/mycompany/common-settings.git + path: configmaps-billing targetRevision: HEAD ``` -The above example has two sources specified. Argo CD will generate the manifests for each source separately and combine +The above example has two sources specified that need to be combined in order to create the "billing" application. Argo CD will generate the manifests for each source separately and combine the resulting manifests. !!! warning "Do not abuse multiple sources" - Note that the example above is just for illustration purposes. This feature is **NOT** destined as a generic way to group your applications. Take a look at [applicationsets](../user-guide/application-set.md) and the [app-of-apps](../../operator-manual/cluster-bootstrapping/) pattern if you want to have a single entity for multiple applications. If you find yourself using more than 2-3 items in the `sources` array then you are almost certainly abusing this feature and you need to rethink your application grouping strategy. + Note this feature is **NOT** destined as a generic way to group different/unrelated applications. Take a look at [applicationsets](../user-guide/application-set.md) and the [app-of-apps](../../operator-manual/cluster-bootstrapping/) pattern if you want to have a single entity for multiple applications. If you find yourself using more than 2-3 items in the `sources` array then you are almost certainly abusing this feature and you need to rethink your application grouping strategy. If multiple sources produce the same resource (same `group`, `kind`, `name`, and `namespace`), the last source to produce the resource will take precedence. Argo CD will produce a `RepeatedResourceWarning` in this case, but it will @@ -45,6 +48,14 @@ sync the resources. This provides a convenient way to override a resource from a ## Helm value files from external Git repository +One of the most common scenarios for using multiple sources is the following + +1. Your organization wants to use an external/public Helm chart +1. You want to override the Helm values with your own local values +1. You don't want to clone the Helm chart locally as well because that would lead to duplication and you would need to monitor it manually for upstream changes. + +In this scenario you can use the multiple sources features to combine the external chart with your own local values. + Helm sources can reference value files from git sources. This allows you to use a third-party Helm chart with custom, git-hosted values.