Skip to content

Commit ea0757a

Browse files
committed
TELCODOCS-2229 updating retail pattern docs 2
1 parent 1701e70 commit ea0757a

File tree

4 files changed

+305
-0
lines changed

4 files changed

+305
-0
lines changed
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
---
2+
title: Managed cluster sites
3+
weight: 30
4+
aliases: /retail/retail-managed-cluster/
5+
---
6+
7+
:toc:
8+
:imagesdir: /images
9+
:_content-type: ASSEMBLY
10+
include::modules/comm-attributes.adoc[]
11+
12+
//leaving this here on purpose to test H1 headings (with ID) in assemblies and it's impact of TOC
13+
[id="attach-managed-cluster"]
14+
= Attach a managed cluster (edge) to the management hub
15+
16+
The use of this Multicloud GitOps pattern depends on having at least one running Red Hat OpenShift cluster.
17+
18+
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.
19+
20+
include::modules/mcg-understanding-rhacm-requirements.adoc[leveloffset=+1]
21+
22+
include::modules/mcg-deploying-managed-cluster-using-rhacm.adoc[leveloffset=+1]
23+
24+
include::modules/comm-deploying-managed-cluster-using-cm-cli-tool.adoc[leveloffset=+1]
25+
26+
include::modules/comm-deploying-managed-cluster-using-clusteradm-tool.adoc[leveloffset=+1]
27+
28+
include::modules/comm-designate-cluster-as-managed-cluster-site.adoc[leveloffset=+2]
29+
30+
31+
== Verification
32+
33+
. Go to your managed cluster (edge) OpenShift console and check for the `open-cluster-management-agent` pod being launched.
34+
35+
[NOTE]
36+
====
37+
It might take a while for the RHACM agent and `agent-addons` to launch.
38+
====
39+
40+
. Check the *Red Hat OpenShift GitOps Operator* is installed.
41+
42+
. 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`.
43+
44+
Verify that the *hello-world* application deployed successfully as follows:
45+
46+
. Navigate to the *Networking* -> *Routes* menu options on your managed cluster (edge) OpenShift.
47+
48+
. From the *Project:* drop down select the *hello-world* project.
49+
50+
. Click the *Location URL*. This should reveal the following:
51+
+
52+
[source,terminal]
53+
----
54+
Hello World!
55+
56+
Hub Cluster domain is 'apps.aws-hub-cluster.openshift.org'
57+
Pod is running on Local Cluster Domain 'apps.aws-hub-cluster.openshift.org'
58+
----
59+
60+
Verify that the *config-demo* application deployed successfully as follows:
61+
62+
. Navigate to the *Networking* -> *Routes* menu options on your managed cluster (edge) OpenShift.
63+
64+
. Select the *config-demo* *Project*.
65+
66+
. Click the *Location URL*. This should reveal the following:
67+
+
68+
[source,terminal]
69+
----
70+
Hub Cluster domain is 'apps.aws-hub-cluster.openshift.org'
71+
Pod is running on Local Cluster Domain 'apps.aws-hub-cluster.openshift.org'
72+
The secret is `secret`
73+
----

modules/retail-about.adoc

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
:_content-type: CONCEPT
2+
:imagesdir: ../../images
3+
4+
[id="about-retail-pattern"]
5+
= About the retail pattern
6+
7+
This pattern demonstrates a pattern that models the store side of a retail application.
8+
9+
It is derived from the https://quarkuscoffeeshop.github.io[Quarkus Coffeeshop Demo] created by Red Hat Solution Architects. The demo showcases the use of multiple microservices that interact through Kafka messaging and persist data in a PostgreSQL database.
10+
11+
This demo pulls together several different strands of the demo and allows for multiple stores to be installed on remote clusters via ACM if the user desires.
12+
13+
The demo allows users to go to the store’s web page, order drinks and food items, and see those items `made` and served by the microservices in real time.
14+
15+
The pattern includes build pipelines and a demo space, so that changes to the applications can be tested prior to `production` deployments.
16+
17+
[id="solution-elements"]
18+
== Solution elements
19+
20+
* How to use a GitOps approach to keep in control of configuration and
21+
operations
22+
* How to centrally manage multiple clusters, including workloads
23+
* How to build and deploy workloads across clusters using modern CI/CD
24+
* How to architect a modern application using microservices and Kafka in Java
25+
26+
27+
[id="rhel-technologies"]
28+
== Red Hat Technologies
29+
30+
* Red Hat OpenShift Container Platform (Kubernetes)
31+
* Red Hat Advanced Cluster Management (Open Cluster Management)
32+
* Red Hat OpenShift GitOps (ArgoCD)
33+
* Red Hat OpenShift Pipelines (Tekton)
34+
* Red Hat AMQ Streams (Apache Kafka Event Broker)

modules/retail-architecture.adoc

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
:_content-type: CONCEPT
2+
:imagesdir: ../../images
3+
4+
[id="overview-architecture"]
5+
= Architecture
6+
7+
The following diagram shows the relationship between the microservices,
8+
messaging, and database components:
9+
10+
link:/images/retail/retail-architecture.png[image:/images/retail/retail-architecture.png[Retail Pattern Architecture]]
11+
12+
* The hub. This cluster hosts the CI/CD pipelines, a test instance of the applications and messaging/database services for testing purposes, and a single functional store.
13+
* Optional remote clusters. Each remote site can support a complete store environment. The default one modelled is a "`RALEIGH`" store location.
14+
15+
[id="demo-scenario"]
16+
== Demo Scenario
17+
18+
The Retail Validated Pattern/Demo Scenario showcases the Quarkus Coffeeshop retail experience. Rather than modeling the complexities of a full retail environment—such as item files, tax tables, and inventory management—it focuses on a subset of services to illustrate data flow, microservice interaction through APIs, messaging, and data persistence.
19+
20+
* Web Service - the point of sale within the store. Shows the menu, and allows the user to order food and drinks, and shows when orders are ready.
21+
* Counter service - the "`heart`" of the store operation - receives orders and dispatches them to the barista and kitchen services, as appropriate. Users may order as many food and drink items in one order as they wish.
22+
* Barista - the service responsible for providing items from the
23+
"`drinks`" side of the menu.
24+
* Kitchen - the service responsible for providing items from the
25+
"`food`" side of the menu.
26+
27+
Further documentation on the individual services is available at the upstream https://quarkuscoffeeshop.github.io/[Quarkus Coffeeshop] documentation site.
28+
29+
link:/images/retail/retail-highlevel.png[image:/images/retail/retail-highlevel.png[Demo Scenario]]

modules/retail-deploying.adoc

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
:_content-type: PROCEDURE
2+
:imagesdir: ../../../images
3+
4+
[id="deploying-retail-pattern"]
5+
= Deploying the retail pattern
6+
7+
.Prerequisites
8+
9+
* An OpenShift cluster
10+
** To create an OpenShift cluster, go to the https://console.redhat.com/[Red Hat Hybrid Cloud console].
11+
** Select *Services \-> Containers \-> Create cluster*.
12+
** The cluster must have a dynamic `StorageClass` to provision `PersistentVolumes`. See link:../../multicloud-gitops/mcg-cluster-sizing[sizing your cluster].
13+
* Optional: A second OpenShift cluster for multicloud demonstration.
14+
//Replaced git and podman prereqs with the tooling dependencies page
15+
* https://validatedpatterns.io/learn/quickstart/[Install the tooling dependencies].
16+
17+
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.
18+
19+
If you do not have a running Red Hat OpenShift cluster, you can start one on a public or private cloud by using https://console.redhat.com/openshift/create[Red Hat Hybrid Cloud Console].
20+
21+
.Procedure
22+
23+
. Fork the https://github.com/validatedpatterns/retail[retail] repository on GitHub.
24+
25+
. Clone the forked copy of this repository.
26+
+
27+
[source,terminal]
28+
----
29+
git clone [email protected]:your-username/retail.git
30+
----
31+
32+
. Create a local copy of the secret values file that can safely include credentials. Run the following commands:
33+
+
34+
[source,terminal]
35+
----
36+
cp values-secret.yaml.template ~/values-secret.yaml
37+
----
38+
39+
. Edit `values-secret.yaml` populating with your quay `username` and `password`.
40+
+
41+
[source,yaml]
42+
---
43+
# NEVER COMMIT THESE VALUES TO GIT
44+
version: "2.0"
45+
secrets:
46+
# These are credentials to allow you to push to your image registry (quay.io) for application images
47+
- name: imageregistry
48+
fields:
49+
# eg. Quay -> Robot Accounts -> Robot Login
50+
- name: username
51+
value: "my-quay-username"
52+
- name: password
53+
value: "my-quay-password"
54+
----
55+
+
56+
[WARNING]
57+
====
58+
Do not commit this file. You do not want to push personal credentials to GitHub.
59+
====
60+
61+
. Customize the deployment for your cluster by following these steps:
62+
63+
.. Create a new branch named my-branch and switch to it by running the following command:
64+
+
65+
[source,terminal]
66+
----
67+
$ git switch -c my-branch
68+
----
69+
70+
.. Edit the `values-hub.yaml` file to customize the deployment for your cluster by running the following command:
71+
+
72+
[source,terminal]
73+
----
74+
$ vi values-global.yaml
75+
----
76+
+
77+
The values that you need to change are under the `imageregistry` key, to use your own account and hostname. If you like, you can change the `git` settings of `account`, `email` and `hostname` to reflect your own account settings.
78+
79+
If you plan to customize the build of the applications themselves, there are `revision` and `imageTag` settings for each of them. The defaults should suffice if you just want to see the apps running.
80+
81+
.. Stage the changes to the `values-hub.yaml` file by running the following commands:
82+
+
83+
[source,terminal]
84+
----
85+
$ git add values-global.yaml
86+
----
87+
88+
.. Commit the changes to the `values-hub.yaml` file by running the following commands:
89+
+
90+
[source,terminal]
91+
----
92+
$ git commit -m "update deployment for my-branch"
93+
----
94+
95+
.. Push the changes to the `values-global.yaml` file by running the following command:
96+
+
97+
[source,terminal]
98+
----
99+
$ git push origin my-branch
100+
----
101+
102+
. Deploy the pattern by running `./pattern.sh make install` or by using the link:/infrastructure/using-validated-pattern-operator/[Validated Patterns Operator].
103+
104+
[id="deploying-cluster-using-patternsh-file"]
105+
== Deploying the pattern by using the pattern.sh script
106+
107+
To deploy the pattern by using the `pattern.sh` script, complete the following steps:
108+
109+
. Log in to your cluster by running the following:
110+
111+
.. Obtain an API token by visiting https://oauth-openshift.apps.<your-cluster>.<domain>/oauth/token/request
112+
113+
.. Log in with this retrieved token by running the following command:
114+
+
115+
[source,terminal]
116+
----
117+
$ oc login --token=<retrieved-token> --server=https://api.<your-cluster>.<domain>:6443
118+
----
119+
120+
. Alternatively log in by running the following command:
121+
+
122+
[source,terminal]
123+
----
124+
$ export KUBECONFIG=~/<path_to_kubeconfig>
125+
----
126+
127+
. Deploy the pattern to your cluster by running the following command:
128+
+
129+
[source,terminal]
130+
----
131+
$ ./pattern.sh make install
132+
----
133+
134+
[id="verify-trvlops-pattern-install"]
135+
== Verify the retail pattern installation
136+
137+
. Verify that the Operators have been installed.
138+
139+
.. To verify, in the OpenShift Container Platform web console, navigate to *Operators → Installed Operators* page.
140+
141+
.. Set your project to `All Projects` and verify the operators are installed and have a status of `Succeeded`.
142+
+
143+
link:/images/retail/retail-v1-operators.png[image:/images/retail/retail-v1-operators.png[retail-v1-operators]]
144+
145+
. Track the progress through the Hub ArgoCD UI from the nines menu.:
146+
+
147+
link:/images/retail/retail-v1-console-menu.png[image:/images/retail/retail-v1-console-menu.png[retail-v1-console-menu]]
148+
149+
Ensure that the Hub ArgoCD instance shows all of its apps in Healthy and Synced status once all of the images have been built:
150+
+
151+
link:/images/retail/retail-v1-argo-apps-p1.png[image:/images/retail/retail-v1-argo-apps-p1.png[retail-v1-argo-apps-p1]]
152+
153+
. Check on the pipelines, if you chose to run them. They should all complete successfully:
154+
+
155+
link:/images/retail/retail-v1-pipelines.png[image:/images/retail/retail-v1-pipelines.png[retail-v1-pipelines]]
156+
157+
. Go to the *Quarkus Coffeeshop Landing Page* where you are presented with the applications in the pattern:
158+
+
159+
link:/images/retail/retail-v1-landing-page.png[image:/images/retail/retail-v1-landing-page.png[retail-v1-landing-page]]
160+
161+
. Click the *Store Web Page* to open the Quarkus Coffeeshop Demo:
162+
+
163+
link:/images/retail/retail-v1-store-page.png[image:/images/retail/retail-v1-store-page.png[retail-v1-store-page]]
164+
165+
. Click the *TEST Store Web Page* to open a separate copy of the same demo.
166+
167+
. Clicking the respective *Kafdrop* links to go to a Kafdrop instance that allows inspection of each of the respective environments.
168+
+
169+
link:/images/retail/retail-v1-kafdrop.png[image:/images/retail/retail-v1-kafdrop.png[retail-v1-kafdrop]]

0 commit comments

Comments
 (0)