|
1 | 1 | = ApplicationSets
|
2 | 2 | include::_attributes.adoc[]
|
3 | 3 |
|
4 |
| -With Argo CD there are often situations where you want to deploy or generate multiple versions of the same Application with variations. These variations can be static, |
5 |
| -i.e. a basic list of differing elements, or dynamic based on external inputs such as git repositories. |
6 |
| - |
7 |
| -This is where the Argo CD link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset[ApplicationSet,window="_blank"] feature |
8 |
| -comes into play. ApplicationSets enables you to generate Application resources using templating. Each ApplicationSet can include one or |
9 |
| -more generators that power the creation of Applications. Argo CD currently includes many different generators and enables users to create custom generators via a Plugin architecture. |
10 |
| - |
11 |
| -There are a number of link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators[generators,window="_blank"] available, some common examples of these generators include: |
12 |
| - |
13 |
| -* Using the link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators-List[List,window="_blank"] generator for generating applications for different environments. We will look at an example of this shortly |
14 |
| -* Leveraging the link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators-Git/[git,window="_blank"] generator to create Applications based on the contents of a git repo, we will look at this in Module 4 as a more dynamic way to generate apps for environments. |
15 |
| -* Using the https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators-Pull-Request/[Pull Request,window="_blank"] generator to provision new environments on the fly to run automated tests before merging the code. |
16 |
| -* Using the link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators-Cluster/[Cluster,window="_blank"] generator to provision an Application across multiple clusters. |
17 |
| -* Using the link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators-Matrix[Matrix,window="_blank"] |
18 |
| -and link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators-Merge[Merge,window="_blank"] to combine the results from multiple generators. |
| 4 | +In this module you will learn how to deploy multiple applications from a single Application using the App-of-Apps pattern |
| 5 | +and the newer ApplicationSets in Argo CD. |
19 | 6 |
|
20 | 7 | [#apps-of-apps]
|
21 | 8 | == App-of-Apps
|
@@ -80,6 +67,51 @@ sed "s/%USER%/{user}/" ~/workshop/content/modules/ROOT/examples/app-of-apps/cool
|
80 | 67 | application.argoproj.io/coolstore created
|
81 | 68 | ----
|
82 | 69 |
|
| 70 | +Go to the Argo CD UI, notice that we have four Applications deployed. These include the `coolstore` App-of-Apps as well as the |
| 71 | +three environment Applications that were deployed by `coolstore`. |
| 72 | + |
| 73 | +image::app-of-apps-tiles.png[] |
| 74 | + |
| 75 | +Click on the `coolstore` tile, notice that it has three resources that it deployed which were the environment Applications. |
| 76 | + |
| 77 | +image::app-of-apps-resources.png[] |
| 78 | + |
| 79 | +Now let's clean-up the Applications however before we do so, have a closer look at the `coolstore` App-of-Apps we deployed: |
| 80 | +[.console-output] |
| 81 | +[source,yaml,subs="attributes+,+macros"] |
| 82 | +---- |
| 83 | +include::ROOT:example$app-of-apps/coolstore-app-of-apps.yaml[] |
| 84 | +---- |
| 85 | + |
| 86 | +Notice there is a finalizer defined, this is required if you want the Application to delete the resources it deployed when |
| 87 | +using the App-of-Apps pattern as per the link:https://argo-cd.readthedocs.io/en/latest/user-guide/app_deletion/#about-the-deletion-finalizer[documentation, window="_blank"]. |
| 88 | + |
| 89 | +[NOTE] |
| 90 | +The kustomize section is used to transform the destination for the Application for your specific user. This is only needed |
| 91 | +here as all users are using the same repository, typically this would not be required. |
| 92 | + |
| 93 | +In this section we have seen how we can use App-of-Apps to deploy multiple Applications stored in git. However this list of |
| 94 | +Applications is static, what if we want to create Applications dynamically based on external sources? This is where |
| 95 | +ApplicationSets come into play. |
| 96 | + |
| 97 | +== ApplicationSets |
| 98 | + |
| 99 | +As we just mentioned, there are often situations where you want to deploy or generate multiple versions of the same Application with variations. These variations can be static, |
| 100 | +i.e. a basic list of differing elements, or dynamic based on external inputs such as git repositories. |
| 101 | + |
| 102 | +This is where the Argo CD link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset[ApplicationSet,window="_blank"] feature |
| 103 | +comes into play. ApplicationSets enables you to generate Application resources using templating. Each ApplicationSet can include one or |
| 104 | +more generators that power the creation of Applications. Argo CD currently includes many different generators and enables users to create custom generators via a Plugin architecture. |
| 105 | + |
| 106 | +There are a number of link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators[generators,window="_blank"] available, some common examples of these generators include: |
| 107 | + |
| 108 | +* Using the link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators-List[List,window="_blank"] generator for generating applications for different environments. We will look at an example of this shortly |
| 109 | +* Leveraging the link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators-Git/[git,window="_blank"] generator to create Applications based on the contents of a git repo, we will look at this in Module 4 as a more dynamic way to generate apps for environments. |
| 110 | +* Using the https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators-Pull-Request/[Pull Request,window="_blank"] generator to provision new environments on the fly to run automated tests before merging the code. |
| 111 | +* Using the link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators-Cluster/[Cluster,window="_blank"] generator to provision an Application across multiple clusters. |
| 112 | +* Using the link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators-Matrix[Matrix,window="_blank"] |
| 113 | +and link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators-Merge[Merge,window="_blank"] to combine the results from multiple generators. |
| 114 | + |
83 | 115 | == Static Generation with List Generator
|
84 | 116 |
|
85 | 117 | Let's look at a simple example of an Application that uses a List generator to create the development and production Applications
|
|
0 commit comments