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
+24-23Lines changed: 24 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ include::_attributes.adoc[]
4
4
In this module you will learn how to deploy multiple applications from a single Application using the App-of-Apps pattern
5
5
and the newer ApplicationSets in Argo CD.
6
6
7
-
[#apps-of-apps]
7
+
[#app-of-apps]
8
8
== App-of-Apps
9
9
10
10
Before we delve into ApplicatioSets, let's dive into the useful link:https://argo-cd.readthedocs.io/en/latest/operator-manual/cluster-bootstrapping/#app-of-apps-pattern[App-of-Apps, window="_blank"]
Wait for all of the Applications to be removed from the Argo CD UI.
114
114
115
+
[#appsets]
115
116
== ApplicationSets
116
117
117
118
As we saw previously, there are often situations where you want to deploy or generate multiple versions of the same Application with variations. These variations can be static,
@@ -130,7 +131,8 @@ Some common examples of these link:https://argo-cd.readthedocs.io/en/stable/oper
130
131
* Using the link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators-Matrix[Matrix,window="_blank"]
131
132
and link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators-Merge[Merge,window="_blank"] to combine the results from multiple generators.
132
133
133
-
== Static Generation with List Generator
134
+
[#appsets-static]
135
+
=== Static Generation with List Generator
134
136
135
137
Let's look at a simple example of an Application that uses a List generator to create Applications for different environments
136
138
for the `coolstore` Application. This will be a similar use case to what we saw with App-of-Apps but done
As we can see ApplicationSets provide an easy way to generate Application objects statically but now let's have a look
227
229
where they really shine, dynamic generation based on external sources.
228
230
229
-
== Dynamic Generation with git Generator
231
+
[#appsets-dynamic]
232
+
=== Dynamic Generation with git Generator
230
233
231
234
A common pattern when deploying an application with kustomize with multiple environments is to have a repository that contains the following structure:
232
235
@@ -386,32 +389,30 @@ oc get apps -n {user}-argocd
386
389
[.console-output]
387
390
[source,yaml,subs="attributes+,+macros"]
388
391
----
389
-
app-dev Synced Healthy
390
-
app-prod Synced Progressing
391
-
coolstore-app-dev Synced Healthy
392
-
coolstore-app-prod Synced Healthy
393
-
dev-tools Synced Healthy
394
-
pipeline-helm Synced Healthy
392
+
NAME SYNC STATUS HEALTH STATUS
393
+
coolstore-dev Synced Healthy
394
+
coolstore-prod Synced Healthy
395
+
coolstore-stage Synced Healthy
396
+
web-dev Synced Healthy
397
+
web-prod Synced Healthy
398
+
web-stage Synced Healthy
395
399
----
396
400
397
-
[NOTE]
398
-
The `app-prod` application may be `Progressing` for awhile or show as `Degraded`, this is because we have not yet deployed the updated
399
-
image generated by the Pipeline in production. We will perform this step in the next section.
400
-
401
-
We can verify that the applications have been created in the Shared OpenShift GitOps by checking the Application tiles.
402
-
403
-
* Go to OpenShift GitOps and select the "app-dev" application in the main page to access the details.
401
+
We can also verify that the applications have been created and are healthy in Argo CD by checking the Application tiles.
404
402
405
-
* On the top-left side, click on *"App details"* to access the information about the application, such as the git repository, the branch where the files are located, the target cluster and namespace where the application is deployed, etc.
403
+
image::coolstore-tiles.png[]
406
404
407
-
If we pay closer attention, there are 3 items worth mentioning to understand the multi-environment management:
405
+
Also in OpenShift check the Topology for `{user}-dev` and click on the Route to view the running Application:
408
406
409
-
* *REPO_URL:* the git repository where our the resources we want to deploy are defined
407
+
image::coolstore-topology.png[]
410
408
411
-
* *TARGET REVISION:* the branch to use
409
+
The application should appear as follows:
412
410
413
-
* *PATH:* the folder that contains the specific values for that environment. Here for example, for the "DEV" environment, we use the file located in "globex/overlays/dev".
411
+
image::coolstore-web.png[]
414
412
415
-
You can see more details by opening the "gitops" repository in gitea, and navigating to "globex" folder.
413
+
[#appsets-conclusion]
414
+
== Conclusion
416
415
417
-
== Combining Generators
416
+
In this module we learned how to deploy multiple Applications quickly and easily using the App-of-Apps pattern
417
+
and ApplicationSets. We saw how ApplicationSets can be used to generate Applications dynamically based
0 commit comments