Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions content/learn/getting-started-multi-cloud-gitops.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Other patterns build upon these concepts, making this an ideal starting point fo

* An OpenShift cluster
** To create an OpenShift cluster, go to the https://console.redhat.com/[Red Hat Hybrid Cloud console].
** Select *Services \-> Containers \-> Create cluster*.
** Select *OpenShift \-> Red Hat OpenShift Container Platform \-> Create cluster*.
** The cluster must have a dynamic `StorageClass` to provision `PersistentVolumes`. Verify that a dynamic `StorageClass` exists before creating one by running the following command:
+
[source,terminal]
Expand All @@ -56,6 +56,8 @@ gp2-csi ebs.csi.aws.com <none>
gp3-csi ebs.csi.aws.com true

----
+
For more information about creating a dynamic `StorageClass`, see the https://docs.openshift.com/container-platform/latest/storage/dynamic-provisioning.html[Dynamic provisioning].

* Optional: A second OpenShift cluster for multicloud demonstration.
//Replaced git and podman prereqs with the tooling dependencies page
Expand Down Expand Up @@ -167,8 +169,8 @@ Choosing a Community Operator warns that Red Hat does not certify Community Oper
.. Select a *Version* (if more than one is available).

.. Select an *Installation mode*:
*** *All namespaces on the cluster (default)* installs the Operator in the default `openshift-operators` namespace to watch and be made available to all namespaces in the cluster. This option is not always available.
*** *A specific namespace on the cluster* allows you to choose a specific, single namespace in which to install the Operator. The Operator will only watch and be made available for use in this single namespace.
+
The only supported mode for this Operator is *All namespaces on the cluster (default)*. This installs the Operator in the default `openshift-operators` namespace to watch and be made available to all namespaces in the cluster. This option is not always available.

.. Select *Automatic* or *Manual* approval strategy.

Expand Down Expand Up @@ -217,7 +219,7 @@ A pop-up error with the message "Oh no! Something went wrong." might appear duri

The {rh-gitops} Operator displays in list of *Installed Operators*. The {rh-gitops} Operator installs the remaining assets and artifacts for this pattern. To view the installation of these assets and artifacts, such as {rh-rhacm-first}, ensure that you switch to *Project:All Projects*.

When viewing the `config-demo` project through the Hub `ArgoCD` UI from the nines menu, it appears stuck in a Degraded state. This is the expected behavior when installing using the OpenShift Container Platform console.
Wait some time for everything to deploy. You can track the progress through the `Hub ArgoCD` UI from the nines menu. The `config-demo` project appears stuck in a `Degraded` state. This is the expected behavior when installing using the OpenShift Container Platform console.

* To resolve this you need to run the following to load the secrets into the vault:
+
Expand Down
2 changes: 1 addition & 1 deletion content/patterns/multicloud-gitops/_index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,5 @@ include::modules/mcg-architecture.adoc[leveloffset=+1]
[id="next-steps_mcg-index"]
== Next steps

* link:mcg-getting-started[Deploy the management hub] using Helm.
* link:mcg-getting-started[Deploy the management hub].
* Add a managed cluster to link:mcg-managed-cluster[deploy the managed cluster piece using ACM].
2 changes: 1 addition & 1 deletion content/patterns/multicloud-gitops/mcg-cluster-sizing.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Cluster sizing
weight: 30
weight: 40
aliases: /multicloud-gitops/mcg-cluster-sizing/
---

Expand Down
157 changes: 81 additions & 76 deletions content/patterns/multicloud-gitops/mcg-demo-script.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Demo Script
weight: 60
title: Verifying the MultiCloud GitOps pattern
weight: 20
aliases: /multicloud-gitops/demo/
---

Expand All @@ -11,111 +11,116 @@ include::modules/comm-attributes.adoc[]

[id="demo-intro"]

== Introduction
The multicloud gitops pattern is designed to be an entrypoint into the Validated Patterns framework. For more information on Validated Patterns visit our link:/[documentation site]
== Verifying the MultiCloud GitOps pattern

[id="demo-objectives"]
The MultiCloud GitOps is designed to be an entrypoint into the Validated Patterns framework. The pattern includes two applications that can help you verify the installation. The `hello-world` application is a simple web page that prints "Hello World!" and the `config-demo` application is a simple web page that prints a secret that is loaded into the vault.

== Objectives
Verify the applications are successfully deployed by following this procedure.

In this demo you will complete the following:

* Prepare your local workstation
* Deploy the pattern
* Extend the pattern with a small tweak
.Procedure
. Check the *Red Hat OpenShift GitOps Operator* is installed.

[id="getting-started"]
. Launch the *Hub OpenShift ArgoCD* console from nines menu in the top right of the OpenShift console and verify the applications report the status `Healthy` and `Synched`.

== Getting Started
Verify that the *hello-world* application deployed successfully as follows:

* Make sure you have met all the link:/learn/quickstart/#installation_prerequisites[installation prerequisites]
* Follow the link:../mcg-getting-started[Getting Started Guide] to ensure that you have met all of the prerequisites
. In the OpenShift console go to the *Networking* -> *Routes* menu options.

[NOTE]
====
This demo begins after `./pattern.sh make install` has been executed
====

[id="demo"]

== Demo

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.
You should be able to click on the nine-box and see the following entries:

image:multicloud-gitops/nine-box.png[]

If you now click on the "Hub ArgoCD" menu entry you will be taken to the ArgoCD instance with all the applications.

image:multicloud-gitops/hub-argocd.png[]
. From the *Project:* drop down select the *hello-world* project.

. Click the *Location* URL. This should reveal the following:
+
[source,terminal]
----
Hello World!

Hub Cluster domain is 'apps.aws-hub-cluster.openshift.org'
Pod is running on Local Cluster Domain 'apps.aws-hub-cluster.openshift.org'
----

[id="secrets"]
Verify that the *config-demo* application deployed successfully as follows:

=== Secrets loading
. In the OpenShift console go to the *Networking* -> *Routes* menu options.

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.
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.
. From the *Project:* drop down select the *config-demo* project.

Let's copy the template to our home folder and reload the secrets:
. Click the *Location* URL. This should reveal the following:
+
[source,terminal]
cp ./values-secret.yaml.template ~/values-secret-multicloud-gitops.yaml
./pattern.sh make load-secrets

----
Hub Cluster domain is 'apps.aws-hub-cluster.openshift.org'
Pod is running on Local Cluster Domain 'apps.aws-hub-cluster.openshift.org'
The secret is `secret`
----

At this point if the `config-demo` application was not green already it should become green in the ArgoCD user interface.
=== Customize the web page

Make a small change to the `hello-world` application to see how the GitOps framework applies the change.

[id="verify"]
.Procedure

=== Verify the test web pages

If you now click on the `Routes` in the `Networking` menu entry you will see the following network routes:

image:multicloud-gitops/network-routes.png[]
. Edit `charts/all/hello-world/templates/hello-world-cm.yaml` adding the line `This is a patched version via git`` as shown below:
+
[source,terminal]
----
</head>
<body>
<h1>Hello World!</h1>
+ <h1>This is a patched version via git</h1>
<br/>
<h2>
Hub Cluster domain is '{{ .Values.global.hubClusterDomain }}' <br>
----

. Add the changes to the staging area by running the following command:
+
[source,terminal]
----
$ git add -u
----

Clicking on the `hello-world` application should show a small demo app that prints "Hello World!":
. Commit this change by running the following command:
+
[source,terminal]
----
$ git commit -a -m "test a change"
----

image:multicloud-gitops/hello-world.png[]
. Push the change to the remote repository by running the following command:
+
[source,terminal]
----
$ git push origin my-branch
----

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:
ArgoCD will apply the change to the `hello-world` application.

image:multicloud-gitops/config-demo.png[]
Verify that the update to the *hello-world* application is successfully applied as follows:

=== Make a small change to the test web pages
. In the OpenShift console go to the *Networking* -> *Routes* menu options.

Now we can try and tweak the hello-world application and add the below line in
the `charts/all/hello-world/templates/hello-world-cm.yaml` file:
[source,patch]
diff --git a/charts/all/hello-world/templates/hello-world-cm.yaml b/charts/all/hello-world/templates/hello-world-cm.yaml
index e59561ca..bd416bc6 100644
--- a/charts/all/hello-world/templates/hello-world-cm.yaml
+++ b/charts/all/hello-world/templates/hello-world-cm.yaml
@@ -14,6 +14,7 @@ data:
</head>
<body>
<h1>Hello World!</h1>
+ <h1>This is a patched version via git</h1>
<br/>
<h2>
Hub Cluster domain is '{{ .Values.global.hubClusterDomain }}' <br>
. From the *Project:* drop down select the *hello-world* project.

. Click the *Location* URL. This should reveal the following:
+
[source,terminal]
----
Hello World!

Once we commit the above change via `git commit -a -m "test a change"` and run
`git push origin my-branch` we will be able to observe argo applying the above
change:
This is a patched version via git

image:multicloud-gitops/config-demo-patched.png[]
Hub Cluster domain is 'apps.aws-hub-cluster.openshift.org'
Pod is running on Local Cluster Domain 'apps.aws-hub-cluster.openshift.org'
----

[id="summary"]

== Summary

You did it! You have completed the deployment of the MultiCloud GitOps pattern
and you made a small local change and applied it via GitOps! Hopefully you are
getting ideas of how you can take advantage of our GitOps framework to deploy
and manage your applications.
You did it! You have completed the deployment of the MultiCloud GitOps pattern and you made a small local change and applied it using GitOps.

Hopefully you are getting ideas of how you can take advantage of our GitOps framework to deploy and manage your applications.

For more information on Validated Patterns visit our
link:https://validatedpatterns.io/[website]
For more information about Validated Patterns visit our
link:https://validatedpatterns.io/[website].
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ include::modules/mcg-deploying-mcg-pattern.adoc[leveloffset=1]
[id="next-steps_mcg-getting-started"]
== Next steps

After the management hub is set up and works correctly, attach one or more managed clusters to the architecture.
After the management hub is set up and working correctly, attach one or more managed clusters to the architecture.

For instructions on deploying the edge, refer to link:../mcg-managed-cluster/[Attach a managed cluster (edge) to the management hub].

Expand Down
48 changes: 46 additions & 2 deletions content/patterns/multicloud-gitops/mcg-managed-cluster.adoc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: Managed cluster sites
weight: 20
weight: 30
aliases: /multicloud-gitops/mcg-managed-cluster/
---

Expand All @@ -13,6 +13,10 @@ include::modules/comm-attributes.adoc[]
[id="attach-managed-cluster"]
= Attach a managed cluster (edge) to the management hub

The use of this Multicloud GitOps pattern depends on having at least one running Red Hat OpenShift cluster.

When you install the multi-cloud GitOps pattern, a hub cluster is setup. The hub cluster serves as the central point for managing and deploying applications across multiple clusters.

include::modules/mcg-understanding-rhacm-requirements.adoc[leveloffset=+1]

include::modules/mcg-deploying-managed-cluster-using-rhacm.adoc[leveloffset=+1]
Expand All @@ -26,4 +30,44 @@ include::modules/comm-designate-cluster-as-managed-cluster-site.adoc[leveloffset

== Verification

Go to your managed cluster (edge) OpenShift console and check for the `open-cluster-management-agent` pod being launched. It might take a while for the RHACM agent and `agent-addons` to launch. After that, the OpenShift GitOps Operator is installed. On successful installation, launch the OpenShift GitOps (ArgoCD) console from the top right of the OpenShift console.
. Go to your managed cluster (edge) OpenShift console and check for the `open-cluster-management-agent` pod being launched.

[NOTE]
====
It might take a while for the RHACM agent and `agent-addons` to launch.
====

. Check the *Red Hat OpenShift GitOps Operator* is installed.

. Launch the *Group-One OpenShift ArgoCD* console from nines menu in the top right of the OpenShift console. Verify the applications report the status `Healthy` and `Synched`.

Verify that the *hello-world* application deployed successfully as follows:

. Navigate to the *Networking* -> *Routes* menu options on your managed cluster (edge) OpenShift.

. From the *Project:* drop down select the *hello-world* project.

. Click the *Location URL*. This should reveal the following:
+
[source,terminal]
----
Hello World!

Hub Cluster domain is 'apps.aws-hub-cluster.openshift.org'
Pod is running on Local Cluster Domain 'apps.aws-hub-cluster.openshift.org'
----

Verify that the *config-demo* application deployed successfully as follows:

. Navigate to the *Networking* -> *Routes* menu options on your managed cluster (edge) OpenShift.

. Select the *config-demo* *Project*.

. Click the *Location URL*. This should reveal the following:
+
[source,terminal]
----
Hub Cluster domain is 'apps.aws-hub-cluster.openshift.org'
Pod is running on Local Cluster Domain 'apps.aws-hub-cluster.openshift.org'
The secret is `secret`
----
32 changes: 27 additions & 5 deletions modules/comm-designate-cluster-as-managed-cluster-site.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,38 @@ To tag the cluster as `clusterGroup=<managed-cluster-group>`, complete the follo

.Procedure

. To find the new cluster, run the following command:
. To list all managed clusters, run the following command:
+
[source,terminal]
----
oc get managedcluster.cluster.open-cluster-management.io
$ oc get managedcluster.cluster.open-cluster-management.io
----
+
This will display a list of managed clusters registered in ACM, including their names and statuses.

. Once you identify the target cluster for example `YOURCLUSTER`, label it with the desired key-value pair to associate it with a group or category. To apply the label, run the following command:
+
[source,terminal]
----
$ oc label managedcluster.cluster.open-cluster-management.io/YOURCLUSTER site=managed-cluster
----

. To apply the label, run the following command:
.Verification

. Confirm that the label was applied by running the following command:
+
[source,terminal]
----
oc label managedcluster.cluster.open-cluster-management.io/YOURCLUSTER site=managed-cluster
----
$ oc get managedcluster.cluster.open-cluster-management.io/YOURCLUSTER --show-labels
----
+
This will display the labels associated with the cluster, verifying that the new label has been successfully added..

. Optional: If you’re grouping clusters under a clusterGroup for example `factory`, `devel`, or `prod`, add the clusterGroup label also by running the following command:
+
[source,terminal]
----
$ oc label managedcluster.cluster.open-cluster-management.io/YOURCLUSTER clusterGroup=<group-name>
----
+
Replace `<group-name>` with the appropriate value, such as `factory`.
Loading
Loading