Skip to content

Commit 1c741bd

Browse files
committed
Update ApplicationSet section
1 parent 51f9200 commit 1c741bd

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed
26.5 KB
Loading

content/modules/ROOT/examples/applicationsets/coolstore-list-appset.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ spec:
1616
- environment: prod
1717
template:
1818
metadata:
19-
name: coolstore-app-{{.environment}}
19+
name: coolstore-{{.environment}}
2020
namespace: $USER-argocd
2121
spec:
2222
destination:
2323
namespace: $USER-{{.environment}}
2424
name: in-cluster
2525
project: $USER
2626
source:
27-
path: add content/modules/ROOT/examples/coolstore/overlays/{{.environment}}
27+
path: content/modules/ROOT/examples/coolstore/overlays/{{.environment}}
2828
repoURL: https://github.com/OpenShiftDemos/advanced-gitops-workshop
2929
targetRevision: HEAD
3030
syncPolicy:

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

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Delete the Application:
107107
[.console-input]
108108
[source,yaml,subs="attributes",role=execute]
109109
----
110-
delete app coolstore -n {user}-argocd
110+
oc delete app coolstore -n {user}-argocd
111111
----
112112

113113
Wait for all of the Applications to be removed from the Argo CD UI.
@@ -121,7 +121,7 @@ This is where the Argo CD link:https://argo-cd.readthedocs.io/en/stable/operator
121121
comes into play. ApplicationSets enables you to generate Application resources using templating. Each ApplicationSet can include one or
122122
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.
123123

124-
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:
124+
Some common examples of these link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Generators[generators,window="_blank"] include:
125125

126126
* 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
127127
* 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.
@@ -133,23 +133,23 @@ and link:https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset
133133
== Static Generation with List Generator
134134

135135
Let's look at a simple example of an Application that uses a List generator to create Applications for different environments
136-
for the `coolstore` Application we deployed earlier. This will be a similar use case to what we saw with App-of-Apps but done
136+
for the `coolstore` Application. This will be a similar use case to what we saw with App-of-Apps but done
137137
with ApplicationSets.
138138

139139
Deploy the ApplicationSet using the following command:
140140

141141
[.console-input]
142142
[source,sh,subs="attributes",role=execute]
143143
----
144-
sed 's/$USER/{user}/' ~/workshop/content/modules/ROOT/examples/coolstore-gitops-appset.yaml | sed 's/$SUBDOMAIN/{subdomain}/' | oc apply -f - -n {user}-argocd
144+
sed 's/$USER/{user}/' ~/workshop/content/modules/ROOT/examples/applicationsets/coolstore-list-appset.yaml | sed 's/$SUBDOMAIN/{subdomain}/' | oc apply -f - -n {user}-argocd
145145
----
146146

147147
Next have a look at the ApplicationSet that was deployed with this command:
148148

149149
[.console-input]
150150
[source,sh,subs="attributes",role=execute]
151151
----
152-
oc get appset coolstore-apps -o yaml -n {user}-argocd | oc neat
152+
oc get appset coolstore -o yaml -n {user}-argocd | oc neat
153153
----
154154

155155
[.console-output]
@@ -167,22 +167,23 @@ spec:
167167
- list: <2>
168168
elements:
169169
- environment: dev <3>
170+
- environment: stage
170171
- environment: prod
171172
goTemplate: true
172173
goTemplateOptions:
173174
- missingkey=error
174175
template: <4>
175176
metadata:
176-
name: coolstore-app-{{.environment}} <5>
177+
name: coolstore-{{.environment}} <5>
177178
namespace: {user}-argocd
178179
spec:
179180
destination:
180181
name: in-cluster
181182
namespace: {user}-{{.environment}}
182183
project: {user}
183184
source:
184-
path: content/modules/ROOT/files/gitops/module-02
185-
repoURL: https://gitea-gitea.{subdomain}/{user}/workshop.git
185+
path: content/modules/ROOT/examples/coolstore/overlays/{{.environment}}
186+
repoURL: https://github.com/OpenShiftDemos/advanced-gitops-workshop
186187
targetRevision: HEAD
187188
syncPolicy:
188189
automated:
@@ -197,8 +198,7 @@ generate applications, basically it is 1:1 per element
197198
<4> The `template` section is where we define the Application resource that the ApplicationSet will create
198199
<5> Here is an example of referencing the `environment` value to template the name.
199200

200-
Note that while we created these Applications earlier, the ApplicationSet will now assume ownership of them, This
201-
can be validated with the following command:
201+
When the ApplicationSet generates the Applications it assumes ownership of them, validate this with the following:
202202

203203
[.console-input]
204204
[source,sh,subs="attributes",role=execute]
@@ -216,15 +216,15 @@ oc get app coolstore-app-dev -o=jsonpath='{.metadata.ownerReferences}' -n {user}
216216
"blockOwnerDeletion": true,
217217
"controller": true,
218218
"kind": "ApplicationSet",
219-
"name": "coolstore-apps",
219+
"name": "coolstore",
220220
"uid": "1cb40de5-09a0-440e-a12e-28941e9c81b1"
221221
}
222222
]
223223
]
224224
----
225225

226226
As we can see ApplicationSets provide an easy way to generate Application objects statically but now let's have a look
227-
at dynamic generation.
227+
where they really shine, dynamic generation based on external sources.
228228

229229
== Dynamic Generation with git Generator
230230

0 commit comments

Comments
 (0)