Skip to content

Commit 41f0afd

Browse files
committed
Update content to include local generation
1 parent 0ab12af commit 41f0afd

File tree

1 file changed

+45
-2
lines changed

1 file changed

+45
-2
lines changed

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

Lines changed: 45 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,50 @@ find ~/workshop/content/modules/ROOT/examples/coolstore-web -print | sort|sed -e
263263
| | | | | | | | | | |--kustomization.yaml
264264
----
265265

266-
Let's deploy these applications using an ApplicationSet as we did previously but this time we will use a git generator.
266+
Let's deploy these applications using an ApplicationSet as we did previously but this time we will use a git generator. However
267+
the git generator is somewhat more complex, let's test it locally first.
268+
269+
Output the ApplicationSet to a file replacing the workshop $USER variable with your user:
270+
271+
[.console-input]
272+
[source,sh,subs="attributes",role=execute]
273+
----
274+
sed 's/$USER/user5/' ~/workshop/content/modules/ROOT/examples/applicationsets/coolstore-git-appset.yaml > ~/appset.yaml
275+
----
276+
277+
Next generate the ApplicationSet locally using the `argocd` CLI:
278+
279+
[.console-input]
280+
[source,sh,subs="attributes",role=execute]
281+
----
282+
argocd appset generate ~/appset.yaml
283+
----
284+
285+
[.console-output]
286+
[source,bash,subs="attributes+,+macros"]
287+
----
288+
NAME CLUSTER NAMESPACE PROJECT STATUS HEALTH SYNCPOLICY CONDITIONS REPO PATH TARGET
289+
{user}-argocd/app-dev in-cluster {user}-dev workshop Auto-Prune <none> https://github.com/OpenShiftDemos/advanced-gitops-workshop content/modules/ROOT/examples/coolstore-web/overlays/dev main
290+
{user}-argocd/app-prod in-cluster {user}-prod workshop Auto-Prune <none> https://github.com/OpenShiftDemos/advanced-gitops-workshop content/modules/ROOT/examples/coolstore-web/overlays/prod main
291+
{user}-argocd/app-stage in-cluster {user}-stage workshop Auto-Prune <none> https://github.com/OpenShiftDemos/advanced-gitops-workshop content/modules/ROOT/examples/coolstore-web/overlays/stage main
292+
----
293+
294+
Three Applications are being generated, one for each environment.
295+
296+
To see the YAML for each Application run the following:
297+
298+
[.console-input]
299+
[source,sh,subs="attributes",role=execute]
300+
----
301+
argocd appset generate ~/appset.yaml -o yaml
302+
----
303+
304+
[IMPORTANT]
305+
Using the CLI to generate Applications is very useful when debugging complex ApplicationSets since
306+
you do not have to spend the time deploying it to the cluster and looking at the Status block to
307+
understand why it isn't working.
308+
309+
Now that the generation has been verified, go ahead and deploy it:
267310

268311
[.console-input]
269312
[source,sh,subs="attributes",role=execute]
@@ -276,7 +319,7 @@ Let's have a quick look at our new ApplicationSet:
276319
[.console-input]
277320
[source,sh,subs="attributes",role=execute]
278321
----
279-
oc get appset web-nodejs -o yaml -n {user}-argocd | oc neat
322+
oc get appset coolstore-web -o yaml -n {user}-argocd | oc neat
280323
----
281324

282325
[.console-output]

0 commit comments

Comments
 (0)