|
| 1 | +--- |
| 2 | +title: Demo Script |
| 3 | +weight: 60 |
| 4 | +aliases: /multicloud-gitops-sgx/demo/ |
| 5 | +--- |
| 6 | + |
| 7 | +include::modules/comm-attributes.adoc[] |
| 8 | +:toc: |
| 9 | +:imagesdir: /images |
| 10 | +:_content-type: REFERENCE |
| 11 | + |
| 12 | +[id="demo-intro"] |
| 13 | + |
| 14 | +== Introduction |
| 15 | +The multicloud gitops pattern is designed to be an entrypoint into the Validated Patterns framework. Demo, accesible within the pattern, contains two applications `config-demo` and `hello-world` to show the basic configuration and execution examples. For more information on Validated Patterns visit our link:/[documentation site]. |
| 16 | + |
| 17 | +[id="demo-objectives"] |
| 18 | + |
| 19 | +== Objectives |
| 20 | + |
| 21 | +In this demo you will complete the following: |
| 22 | + |
| 23 | +* Prepare your local workstation |
| 24 | +* Deploy the pattern |
| 25 | +* Extend the pattern with a small tweak |
| 26 | + |
| 27 | +[id="getting-started"] |
| 28 | + |
| 29 | +== Getting Started |
| 30 | + |
| 31 | +* Make sure you have met all the link:/learn/quickstart/#installation_prerequisitesrequirements[requirements] |
| 32 | +* Follow the link:../mcg-sgx-getting-started[Getting Started Guide] to ensure that you have met all of the prequisites |
| 33 | + |
| 34 | +[NOTE] |
| 35 | +==== |
| 36 | +This demo begins after `./pattern.sh make install` has been executed |
| 37 | +==== |
| 38 | + |
| 39 | +[id="demo"] |
| 40 | + |
| 41 | +== Demo |
| 42 | + |
| 43 | +Now that we have deployed the pattern onto our cluster, with `origin` pointing to your fork and using `my-branch` as the name of the used branch, we can begin to discover what has happened. |
| 44 | +You should be able to click on the nine-box and see the following entries: |
| 45 | + |
| 46 | +image:multicloud-gitops-sgx/nine-box.png[] |
| 47 | + |
| 48 | +If you now click on the "Hub ArgoCD" menu entry you will be taken to the ArgoCD instance with all the applications. |
| 49 | + |
| 50 | +image:multicloud-gitops-sgx/hub-argocd.png[] |
| 51 | + |
| 52 | + |
| 53 | + |
| 54 | +[id="secrets"] |
| 55 | + |
| 56 | +=== Secrets loading |
| 57 | + |
| 58 | +By default in the MultiCloud GitOps pattern the secrets get loaded automatically via an out of band process inside the vault running in the OCP cluster. This means that running `./pattern.sh make install` will also call the `load-secrets` makefile target. |
| 59 | +This `load-secrets` target will look for a yaml file describing the secrets to be loaded into vault and in case it cannot find one it will use the `values-secret.yaml.template` file in the git repo to try and generate random secrets. |
| 60 | + |
| 61 | +Let's copy the template to our home folder and reload the secrets: |
| 62 | +[source,terminal] |
| 63 | +cp ./values-secret.yaml.template ~/values-secret-multicloud-gitops.yaml |
| 64 | +./pattern.sh make load-secrets |
| 65 | + |
| 66 | +At this point if the `config-demo` application was not green already it should become green in the ArgoCD user interface. |
| 67 | + |
| 68 | + |
| 69 | +[id="verify"] |
| 70 | + |
| 71 | +=== Verify the test web pages |
| 72 | + |
| 73 | +If you now click on the `Routes` in the `Networking` menu entry you will see the following network routes: |
| 74 | + |
| 75 | +image:multicloud-gitops-sgx/network-routes.png[] |
| 76 | + |
| 77 | +Clicking on the `hello-world` application should show a small demo app that prints "Hello World!": |
| 78 | + |
| 79 | +image:multicloud-gitops-sgx/hello-world.png[] |
| 80 | + |
| 81 | +Once the secrets are loaded correctly inside the vault, clicking on the `config-demo` route should display a small application where said secret is shown: |
| 82 | + |
| 83 | +image:multicloud-gitops-sgx/config-demo.png[] |
| 84 | + |
| 85 | +=== Make a small change to the test web pages |
| 86 | + |
| 87 | +Now we can try and tweak the hello-world application and add the below line in |
| 88 | +the `charts/all/hello-world/templates/hello-world-cm.yaml` file: |
| 89 | +[source,patch] |
| 90 | +diff --git a/charts/all/hello-world/templates/hello-world-cm.yaml b/charts/all/hello-world/templates/hello-world-cm.yaml |
| 91 | +index e59561ca..bd416bc6 100644 |
| 92 | +--- a/charts/all/hello-world/templates/hello-world-cm.yaml |
| 93 | ++++ b/charts/all/hello-world/templates/hello-world-cm.yaml |
| 94 | +@@ -14,6 +14,7 @@ data: |
| 95 | + </head> |
| 96 | + <body> |
| 97 | + <h1>Hello World!</h1> |
| 98 | ++ <h1>This is a patched version via git</h1> |
| 99 | + <br/> |
| 100 | + <h2> |
| 101 | + Hub Cluster domain is '{{ .Values.global.hubClusterDomain }}' <br> |
| 102 | + |
| 103 | + |
| 104 | +Once we commit the above change via `git commit -a -m "test a change"` and run |
| 105 | +`git push origin my-branch` we will be able to observe argo applying the above |
| 106 | +change: |
| 107 | + |
| 108 | +image:multicloud-gitops-sgx/config-demo-patched.png[] |
| 109 | + |
| 110 | +[id="summary"] |
| 111 | + |
| 112 | +== Summary |
| 113 | + |
| 114 | +You did it! You have completed the deployment of the MultiCloud GitOps pattern |
| 115 | +and you made a small local change and applied it via GitOps! Hopefully you are |
| 116 | +getting ideas of how you can take advantage of our GitOps framework to deploy |
| 117 | +and manage your applications. |
| 118 | + |
| 119 | +For more information on Validated Patterns visit our |
| 120 | +link:https://validatedpatterns.io/[website] |
0 commit comments