Skip to content

Commit ef9ab29

Browse files
committed
Update to use overlays for apps
1 parent 5e18224 commit ef9ab29

8 files changed

Lines changed: 47 additions & 7 deletions

File tree

content/modules/ROOT/examples/app-of-apps/base/coolstore-dev.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
name: in-cluster
1212
project: workshop
1313
source:
14-
path: content/modules/ROOT/examples/coolstore/base
14+
path: content/modules/ROOT/examples/coolstore/overlays/dev
1515
repoURL: https://github.com/OpenShiftDemos/advanced-gitops-workshop.git
1616
targetRevision: HEAD
1717
syncPolicy:

content/modules/ROOT/examples/app-of-apps/base/coolstore-prod.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
name: in-cluster
1212
project: workshop
1313
source:
14-
path: content/modules/ROOT/examples/coolstore/base
14+
path: content/modules/ROOT/examples/coolstore/overlays/prod
1515
repoURL: https://github.com/OpenShiftDemos/advanced-gitops-workshop.git
1616
targetRevision: HEAD
1717
syncPolicy:

content/modules/ROOT/examples/app-of-apps/base/coolstore-stage.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
name: in-cluster
1212
project: workshop
1313
source:
14-
path: content/modules/ROOT/examples/coolstore/base
14+
path: content/modules/ROOT/examples/coolstore/overlays/stage
1515
repoURL: https://github.com/OpenShiftDemos/advanced-gitops-workshop.git
1616
targetRevision: HEAD
1717
syncPolicy:
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
apiVersion: argoproj.io/v1alpha1
2+
kind: ApplicationSet
3+
metadata:
4+
name: coolstore
5+
namespace: $USER-argocd
6+
finalizers:
7+
- resources-finalizer.argocd.argoproj.io/background
8+
spec:
9+
goTemplate: true
10+
goTemplateOptions: ["missingkey=error"]
11+
generators:
12+
- list:
13+
elements:
14+
- environment: dev
15+
- environment: stage
16+
- environment: prod
17+
template:
18+
metadata:
19+
name: coolstore-app-{{.environment}}
20+
namespace: $USER-argocd
21+
spec:
22+
destination:
23+
namespace: $USER-{{.environment}}
24+
name: in-cluster
25+
project: $USER
26+
source:
27+
path: add content/modules/ROOT/examples/coolstore/overlays/{{.environment}}
28+
repoURL: https://github.com/OpenShiftDemos/advanced-gitops-workshop
29+
targetRevision: HEAD
30+
syncPolicy:
31+
automated:
32+
prune: true
33+
selfHeal: true
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
resources:
2+
- ../../base
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
resources:
2+
- ../../base
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
resources:
2+
- ../../base

content/modules/ROOT/pages/04-applicationsets.adoc

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,10 @@ ApplicationSets come into play.
9696

9797
== ApplicationSets
9898

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,
99+
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,
100100
i.e. a basic list of differing elements, or dynamic based on external inputs such as git repositories.
101101

102-
This is where the Argo CD link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset[ApplicationSet,window="_blank"] feature
102+
This is where the Argo CD link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset[ApplicationSet,window="_blank"] feature, particularly for the dynamic use case,
103103
comes into play. ApplicationSets enables you to generate Application resources using templating. Each ApplicationSet can include one or
104104
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.
105105

@@ -114,8 +114,9 @@ and link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset
114114

115115
== Static Generation with List Generator
116116

117-
Let's look at a simple example of an Application that uses a List generator to create the development and production Applications
118-
for the `coolstore-app` Application we deployed earlier.
117+
Let's look at a simple example of an Application that uses a List generator to create Applications for different environments
118+
for the `coolstore` Application we deployed earlier. This will be a similar use case to what we saw with App-of-Apps but done
119+
with ApplicationSets.
119120

120121
Deploy the ApplicationSet using the following command:
121122

0 commit comments

Comments
 (0)