You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/modules/ROOT/pages/04-applicationsets.adoc
+27-16Lines changed: 27 additions & 16 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,9 @@ Before we delve into ApplicatioSets, let's dive into the useful link:https://arg
11
11
pattern which predates ApplicationSets.
12
12
13
13
The concept of App-of-Apps is that you have an Application in Argo CD that points to a location that consists only of Applications. This enables bootstrapping a set of
14
-
Applications from a single Application and is useful in use cases such as cluster configuration and multiple environments.
14
+
Applications from a single Application and is useful in use cases such as cluster configuration and same app with multiple environments scenarios.
15
15
16
-
Before we can deploy the App-of-Apps, we first need to deploy a health check for the Application resource which is not included as an included health check in Argo CD at this time.
16
+
Before we can deploy the App-of-Apps, we first need to deploy a health check for the Application resource which is not included as a health check in Argo CD at this time.
17
17
18
18
[NOTE]
19
19
This is because in Argo CD 1.x the default Application health check was removed, the author of this workshop link:https://github.com/argoproj/argo-cd/issues/16870[disagrees, window="_blank"] with
Next review the applications that the App-of-Apps will be deploying:
37
37
38
-
[.console-output]
38
+
[.console-input]
39
39
[source,bash,subs="attributes+,+macros"]
40
40
----
41
41
ls -l ~/workshop/content/modules/ROOT/examples/app-of-apps/base/
@@ -54,7 +54,8 @@ total 12
54
54
There are three Applications defined, one for each environment, with kustomize being used to manage them. If you look at each
55
55
of these Applications note that each environment is tied to a different kustomize overlay matching the destination. This
56
56
provides an opportunity to tweak the manifests for anything specific to an environment. For example, if you look at the overlays
57
-
the `stage` and `prod` environments are patching the vertx-gateway deployment to have two replicas.
57
+
for the `stage` and `prod` environments we are patching the vertx-gateway deployment to have two replicas instead of the default
58
+
one replica defined in the base.
58
59
59
60
[source,yaml,subs="+macros,attributes+"]
60
61
----
@@ -76,11 +77,11 @@ application.argoproj.io/coolstore created
76
77
----
77
78
78
79
Go to the Argo CD UI, notice that we have four Applications deployed. These include the `coolstore` App-of-Apps as well as the
79
-
three environment Applications that were deployed by `coolstore`.
80
+
three environment specific Applications that were deployed by the `coolstore` App-of-Apps.
80
81
81
82
image::app-of-apps-tiles.png[]
82
83
83
-
Click on the `coolstore` tile, notice that it has three resources that it deployed which were the environment Applications.
84
+
Click on the `coolstore` tile, notice that it has three resources that it deployed which were the environment specific Applications.
84
85
85
86
image::app-of-apps-resources.png[]
86
87
@@ -134,7 +135,7 @@ and link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset
134
135
[#appsets-static]
135
136
=== Static Generation with List Generator
136
137
137
-
Let's look at a simple example of an Application that uses a List generator to create Applications for different environments
138
+
First let's look at a simple example of an Application that uses a List generator to create Applications for different environments
138
139
for the `coolstore` Application. This will be a similar use case to what we saw with App-of-Apps but done
139
140
with ApplicationSets.
140
141
@@ -231,16 +232,24 @@ where they really shine, dynamic generation based on external sources.
231
232
[#appsets-dynamic]
232
233
=== Dynamic Generation with git Generator
233
234
234
-
A common pattern when deploying an application with kustomize with multiple environments is to have a repository that contains the following structure:
235
+
In this example we will deploy the front-end of the coolstore using an ApplicationSet with the git generator. The
236
+
git generator supports two modes, file and directory. In our case we will leverage the directory mode to
237
+
point the generator at a set of kustomize overlays in the repository.
238
+
239
+
For those not familiar with kustomize, a common pattern when deploying an application with kustomize for multiple
240
+
environments is to have a repository that contains a `base` and `overlays` folders. The base folder contains
241
+
all of the manifests to be deployed. The `overlays` are used to patch the base to handle any
242
+
environment specific differences.
243
+
244
+
The structure of `base` and `overlays` we will be using in this example is as follows:
235
245
236
246
* *base*: the common assets that we want to deploy
237
247
* *overlays*:
238
248
** *dev*: specific values that will override the ones in the base for the "dev" environment
239
249
** *stage*: specific values that will override the ones in the base for the "stage" environment
240
250
** *prod*: specific values that will override the ones in the base for the "prod" environment
241
251
242
-
We will be deploying the web frontend for the backend we deployed in the previous section, view the
243
-
structure in the cloned repository:
252
+
View this structure in the repository that was cloned earlier:
0 commit comments