Skip to content

Commit d01c0d1

Browse files
authored
Merge pull request #489 from kquinn1204/TELCODOCS-2082
TELCODOCS-2082 VP Quick start guide redo
2 parents 29e683f + c9fbff9 commit d01c0d1

File tree

8 files changed

+621
-71
lines changed

8 files changed

+621
-71
lines changed
Lines changed: 311 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,311 @@
1+
---
2+
menu:
3+
learn:
4+
parent: Patterns quick start
5+
title: Getting Started with Multicloud GitOps
6+
aliases: /infrastructure/using-validated-pattern-operator/
7+
weight: 20
8+
---
9+
10+
:toc:
11+
:imagesdir: /images
12+
:_content-type: ASSEMBLY
13+
include::modules/comm-attributes.adoc[]
14+
15+
== Getting Started with Multicloud GitOps
16+
17+
Multicloud GitOps is a foundational pattern that demonstrates GitOps principles for managing applications across multiple clusters. It provides:
18+
19+
* A GitOps framework using `ArgoCD`
20+
* Infrastructure-as-Code practices
21+
* Multi-cluster management capabilities
22+
* Template for secure secret management
23+
24+
Red Hat recommend the Multicloud GitOps pattern as your base pattern because:
25+
26+
. It establishes core GitOps practices
27+
. Provides a minimal but complete implementation
28+
. Serves as a foundation for other patterns
29+
. Demonstrates key validated patterns concepts
30+
31+
[NOTE]
32+
====
33+
Other patterns build upon these concepts, making this an ideal starting point for your validated patterns journey.
34+
====
35+
36+
== Deploying the Multicloud GitOps pattern
37+
38+
.Prerequisites
39+
40+
* An OpenShift cluster
41+
** To create an OpenShift cluster, go to the https://console.redhat.com/[Red Hat Hybrid Cloud console].
42+
** Select *Services \-> Containers \-> Create cluster*.
43+
** The cluster must have a dynamic `StorageClass` to provision `PersistentVolumes`. Verify that a dynamic `StorageClass` exists before creating one by running the following command:
44+
+
45+
[source,terminal]
46+
----
47+
$ oc get storageclass -o custom-columns=NAME:.metadata.name,PROVISIONER:.provisioner,DEFAULT:.metadata.annotations."storageclass\.kubernetes\.io/is-default-class"
48+
----
49+
+
50+
.Example output
51+
+
52+
[source,terminal]
53+
----
54+
NAME PROVISIONER DEFAULT
55+
gp2-csi ebs.csi.aws.com <none>
56+
gp3-csi ebs.csi.aws.com true
57+
58+
----
59+
60+
* Optional: A second OpenShift cluster for multicloud demonstration.
61+
//Replaced git and podman prereqs with the tooling dependencies page
62+
* https://validatedpatterns.io/learn/quickstart/[Install the tooling dependencies].
63+
64+
The use of this pattern depends on having at least one running Red Hat OpenShift cluster. However, consider creating a cluster for deploying the GitOps management hub assets and a separate cluster for the managed cluster.
65+
66+
If you do not have a running Red Hat OpenShift cluster, you can start one on a
67+
public or private cloud by using https://console.redhat.com/openshift/create[Red Hat Hybrid Cloud Console].
68+
69+
.Procedure
70+
71+
. From the https://github.com/validatedpatterns/multicloud-gitops[multicloud-gitops] repository on GitHub, click the Fork button.
72+
73+
. Clone the forked copy of this repository by running the following command.
74+
+
75+
[source,terminal]
76+
----
77+
$ git clone [email protected]:<your-username>/multicloud-gitops.git
78+
----
79+
80+
. Navigate to your repository: Ensure you are in the root directory of your Git repository by using:
81+
+
82+
[source,terminal]
83+
----
84+
$ cd /path/to/your/repository
85+
----
86+
87+
. Run the following command to set the upstream repository:
88+
+
89+
[source,terminal]
90+
----
91+
$ git remote add -f upstream [email protected]/validatedpatterns/multicloud-gitops.git
92+
----
93+
94+
. Verify the setup of your remote repositories by running the following command:
95+
+
96+
[source,terminal]
97+
----
98+
$ git remote -v
99+
----
100+
+
101+
.Example output
102+
+
103+
[source,terminal]
104+
----
105+
origin [email protected]:<your-username>/multicloud-gitops.git (fetch)
106+
origin [email protected]:<your-username>/multicloud-gitops.git (push)
107+
upstream https://github.com/validatedpatterns/multicloud-gitops.git (fetch)
108+
upstream https://github.com/validatedpatterns/multicloud-gitops.git (push)
109+
----
110+
111+
. Create a local copy of the secret values file that can safely include credentials. Run the following commands:
112+
+
113+
[source,terminal]
114+
----
115+
$ cp values-secret.yaml.template ~/values-secret-multicloud-gitops.yaml
116+
----
117+
+
118+
[NOTE]
119+
====
120+
Putting the `values-secret.yaml` in your home directory ensures that it does not get pushed to your git repository. It is based on the `values-secrets.yaml.template` file provided by the pattern in the top level directory. When you create your own patterns you will add your secrets to this file and save. At the moment the focus is on getting started and familiar with this base Multicloud GitOps pattern.
121+
====
122+
123+
. Create a new feature branch, for example `my-branch` from the `main` branch for your content:
124+
+
125+
[source,terminal]
126+
----
127+
$ git checkout -b my-branch main
128+
----
129+
130+
. Create a local branch and push it to origin to gain the flexibility needed to customize the base Multicloud GitOps by running the following command:
131+
+
132+
[source,terminal]
133+
----
134+
$ git push origin my-branch
135+
----
136+
137+
You can proceed to install the Multicloud GitOps pattern by using the web console or from command line by using the script `./pattern.sh` script.
138+
139+
To install the Multicloud GitOps pattern by using the web console you must first install the Validated Patterns Operator. The Validated Patterns Operator installs and manages Validated Patterns.
140+
141+
//Include Procedure module here
142+
[id="installing-validated-patterns-operator_{context}"]
143+
== Installing the {validated-patterns-op} using the web console
144+
145+
.Prerequisites
146+
* Access to an {ocp} cluster by using an account with `cluster-admin` permissions.
147+
148+
.Procedure
149+
150+
. Navigate in the {hybrid-console-first} to the *Operators* → *OperatorHub* page.
151+
152+
. Scroll or type a keyword into the *Filter by keyword* box to find the Operator you want. For example, type `validated patterns` to find the {validated-patterns-op}.
153+
154+
. Select the Operator to display additional information.
155+
+
156+
[NOTE]
157+
====
158+
Choosing a Community Operator warns that Red Hat does not certify Community Operators; you must acknowledge the warning before continuing.
159+
====
160+
161+
. Read the information about the Operator and click *Install*.
162+
163+
. On the *Install Operator* page:
164+
165+
.. Select an *Update channel* (if more than one is available).
166+
167+
.. Select a *Version* (if more than one is available).
168+
169+
.. Select an *Installation mode*:
170+
*** *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.
171+
*** *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.
172+
173+
.. Select *Automatic* or *Manual* approval strategy.
174+
175+
. Click *Install* to make the Operator available to the selected namespaces on this {ocp} cluster.
176+
177+
.Verification
178+
To confirm that the installation is successful:
179+
180+
. Navigate to the *Operators* → *Installed Operators* page.
181+
182+
. Check that the Operator is installed in the selected namespace and its status is `Succeeded`.
183+
184+
//Include Procedure module here
185+
[id="create-pattern-instance_{context}"]
186+
== Creating the Multicloud GitOps instance
187+
188+
.Prerequisites
189+
The {validated-patterns-op} is successfully installed in the relevant namespace.
190+
191+
.Procedure
192+
193+
. Navigate to the *Operators* → *Installed Operators* page.
194+
195+
. Click the installed *{validated-patterns-op}*.
196+
197+
. Under the *Details* tab, in the *Provided APIs* section, in the
198+
*Pattern* box, click *Create instance* that displays the *Create Pattern* page.
199+
200+
. On the *Create Pattern* page, select *Form view* and enter information in the following fields:
201+
202+
** *Name* - A name for the pattern deployment that is used in the projects that you created.
203+
** *Labels* - Apply any other labels you might need for deploying this pattern.
204+
** *Cluster Group Name* - Select a cluster group name to identify the type of cluster where this pattern is being deployed. For example, if you are deploying the {ie-pattern}, the cluster group name is `datacenter`. If you are deploying the {mcg-pattern}, the cluster group name is `hub`.
205+
+
206+
To know the cluster group name for the patterns that you want to deploy, check the relevant pattern-specific requirements.
207+
. Expand the *Git Config* section to reveal the options and enter the required information.
208+
. Leave *In Cluster Git Server* unchanged.
209+
.. Change the *Target Repo* URL to your forked repository URL. For example, change `+https://github.com/validatedpatterns/<pattern_name>+` to `+https://github.com/<your-git-username>/<pattern-name>+`
210+
.. Optional: You might need to change the *Target Revision* field. The default value is `HEAD`. However, you can also provide a value for a branch, tag, or commit that you want to deploy. For example, `v2.1`, `main`, or a branch that you created, `my-branch`.
211+
. Click *Create*.
212+
+
213+
[NOTE]
214+
====
215+
A pop-up error with the message "Oh no! Something went wrong." might appear during the process. This error can be safely disregarded as it does not impact the installation of the Multicloud GitOps pattern. Use the Hub ArgoCD UI, accessible through the nines menu, to check the status of ArgoCD instances, which will display states such as progressing, healthy, and so on, for each managed application. The Cluster ArgoCD provides detailed status on each application, as defined in the clustergroup values file.
216+
====
217+
218+
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*.
219+
220+
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.
221+
222+
* To resolve this you need to run the following to load the secrets into the vault:
223+
+
224+
[source,terminal]
225+
----
226+
$ ./pattern.sh make load-secrets
227+
----
228+
+
229+
[NOTE]
230+
====
231+
You must have created a local copy of the secret values file by running the following command:
232+
233+
[source,terminal]
234+
----
235+
$ cp values-secret.yaml.template ~/values-secret-multicloud-gitops.yaml
236+
----
237+
====
238+
239+
The deployment will not take long but it should deploy successfully.
240+
241+
Alternatively you can deploy the Multicloud GitOps pattern by using the command line script `pattern.sh`.
242+
243+
[id="deploying-cluster-using-patternsh-file"]
244+
== Deploying the cluster by using the pattern.sh file
245+
246+
To deploy the cluster by using the `pattern.sh` file, complete the following steps:
247+
248+
. Log in to your cluster by running the following command:
249+
+
250+
[source,terminal]
251+
----
252+
$ oc login
253+
----
254+
+
255+
Optional: Set the `KUBECONFIG` variable for the `kubeconfig` file path:
256+
+
257+
[source,terminal]
258+
----
259+
$ export KUBECONFIG=~/<path_to_kubeconfig>
260+
----
261+
262+
. Deploy the pattern to your cluster. Run the following command:
263+
+
264+
[source,terminal]
265+
----
266+
$ ./pattern.sh make install
267+
----
268+
269+
. Verify that the Operators have been installed.
270+
.. To verify, in the OpenShift Container Platform web console, navigate to *Operators → Installed Operators* page.
271+
.. Check that the Operator is installed in the `openshift-operators` namespace and its status is `Succeeded`.
272+
. Verify that all applications are synchronized. Under the project `multicloud-gitops-hub` click the URL for the `hub` gitops `server`. The Vault application is not synched.
273+
+
274+
image::multicloud-gitops/multicloud-gitops-argocd.png[Multicloud GitOps Hub]
275+
276+
As part of installing by using the script `pattern.sh` pattern, HashiCorp Vault is installed. Running `./pattern.sh make install` also calls the `load-secrets` makefile target. This `load-secrets` target looks 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 repository to try to generate random secrets.
277+
278+
For more information, see section on https://validatedpatterns.io/secrets/vault/[Vault].
279+
280+
.Verification of test pages
281+
282+
Verify that the *hello-world* application deployed successfully as follows:
283+
284+
. Navigate to the *Networking* -> *Routes* menu options.
285+
286+
. From the *Project:* drop down select the *hello-world* project.
287+
288+
. Click the *Location URL*. This should reveal the following:
289+
+
290+
[source,terminal]
291+
----
292+
Hello World!
293+
294+
Hub Cluster domain is 'apps.aws-hub-cluster.openshift.org'
295+
Pod is running on Local Cluster Domain 'apps.aws-hub-cluster.openshift.org'
296+
----
297+
298+
Verify that the *config-demo* application deployed successfully as follows:
299+
300+
. Navigate to the *Networking* -> *Routes* menu options.
301+
302+
. Select the *config-demo* *Project*.
303+
304+
. Click the *Location URL*. This should reveal the following:
305+
+
306+
[source,terminal]
307+
----
308+
Hub Cluster domain is 'apps.aws-hub-cluster.openshift.org'
309+
Pod is running on Local Cluster Domain 'apps.aws-hub-cluster.openshift.org'
310+
The secret is `secret`
311+
----

0 commit comments

Comments
 (0)