Skip to content

Commit 76e7d05

Browse files
authored
Merge pull request #101475 from EricPonvelle/OSDOCS-16525_ROSA-Learning
OSDOCS-16525: Updating ROSA Learning for DITA compliance
2 parents 79951e1 + 60bcf6f commit 76e7d05

File tree

83 files changed

+2776
-2414
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+2776
-2414
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * rosa_learning/deploying_application_workshop/learning-deploying-application-deployment.adoc
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="learning-deploying-application-deployment-backend-microservice_{context}"]
6+
= Deploying the back-end microservice
7+
8+
The microservice serves internal web requests and returns a JSON object containing the current hostname and a randomly generated color string.
9+
10+
.Procedure
11+
* Deploy the microservice by running the following command:
12+
+
13+
[source,terminal]
14+
----
15+
$ oc apply -f https://raw.githubusercontent.com/openshift-cs/rosaworkshop/master/rosa-workshop/ostoy/yaml/ostoy-microservice-deployment.yaml
16+
----
17+
+
18+
.Example output
19+
[source,terminal]
20+
----
21+
$ oc apply -f https://raw.githubusercontent.com/openshift-cs/rosaworkshop/master/rosa-workshop/ostoy/yaml/ostoy-microservice-deployment.yaml
22+
deployment.apps/ostoy-microservice created
23+
service/ostoy-microservice-svc created
24+
----
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * rosa_learning/deploying_application_workshop/learning-deploying-application-deployment.adoc
4+
:_mod-docs-content-type: CONCEPT
5+
[id="learning-deploying-application-deployment-creating-new-project_{context}"]
6+
= Creating a new project
7+
8+
Use your preferred interface to create a new project.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * rosa_learning/deploying_application_workshop/learning-deploying-application-deployment.adoc
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="learning-deploying-application-deployment-frontend-microservice_{context}"]
6+
= Deploying the front-end microservice
7+
8+
The front-end deployment uses the Node.js front-end for the application and additional Kubernetes objects.
9+
10+
Front-end deployment defines the following features:
11+
12+
* Persistent volume claim
13+
* Deployment object
14+
* Service
15+
* Route
16+
* ConfigMaps
17+
* Secrets
18+
19+
.Procedure
20+
* Deploy the application front-end and create the objects by running the following command:
21+
+
22+
[source,terminal]
23+
----
24+
$ oc apply -f https://raw.githubusercontent.com/openshift-cs/rosaworkshop/master/rosa-workshop/ostoy/yaml/ostoy-frontend-deployment.yaml
25+
----
26+
+
27+
.Example output
28+
[source,terminal]
29+
----
30+
persistentvolumeclaim/ostoy-pvc created
31+
deployment.apps/ostoy-frontend created
32+
service/ostoy-frontend-svc created
33+
route.route.openshift.io/ostoy-route created
34+
configmap/ostoy-configmap-env created
35+
secret/ostoy-secret-env created
36+
configmap/ostoy-configmap-files created
37+
secret/ostoy-secret created
38+
----
39+
+
40+
All objects should create successfully.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * rosa_learning/deploying_application_workshop/learning-deploying-application-deployment.adoc
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="learning-deploying-application-deployment-new-project-cli_{context}"]
6+
= Creating a new project using the CLI
7+
8+
[role="_abstract"]
9+
You can use {oc-first} to create a new project.
10+
11+
.Procedure
12+
* Create a new project named `ostoy` in your cluster by running following command:
13+
+
14+
[source,terminal]
15+
----
16+
$ oc new-project ostoy
17+
----
18+
+
19+
.Example output
20+
[source,terminal]
21+
----
22+
Now using project "ostoy" on server "https://api.myrosacluster.abcd.p1.openshiftapps.com:6443".
23+
----
24+
25+
** *Optional*: Create a unique project name by running the following command:
26+
+
27+
[source,terminal]
28+
----
29+
$ oc new-project ostoy-$(uuidgen | cut -d - -f 2 | tr '[:upper:]' '[:lower:]')
30+
----
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * rosa_learning/deploying_application_workshop/learning-deploying-application-deployment.adoc
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="learning-deploying-application-deployment-new-project-ui_{context}"]
6+
= Creating a new project using the web console
7+
8+
[role="_abstract"]
9+
You can use {cluster-manager} to create a new project.
10+
11+
.Procedure
12+
. From the web console, click *Home -> Projects*.
13+
14+
. On the *Projects* page, click create *Create Project*.
15+
+
16+
image::4-createnewproj.png[The project creation screen]
17+
18+
. In the *Create Project* box, enter a project name in the *Name* field.
19+
20+
. Click *Create*.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * rosa_learning/deploying_application_workshop/learning-deploying-application-deployment.adoc
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="learning-deploying-application-deployment-obtain-route_{context}"]
6+
= Obtain the route to your application
7+
8+
Obtain the route to access the application.
9+
10+
.Procedure
11+
* Get the route to your application by running the following command:
12+
+
13+
[source,terminal]
14+
----
15+
$ oc get route
16+
----
17+
+
18+
.Example output
19+
[source,terminal]
20+
----
21+
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
22+
ostoy-route ostoy-route-ostoy.apps.<your-rosa-cluster>.abcd.p1.openshiftapps.com ostoy-frontend-svc <all> None
23+
----
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * rosa_learning/deploying_application_workshop/learning-deploying-application-deployment.adoc
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="learning-deploying-application-deployment-retrieving-login_{context}"]
6+
= Retrieving the login command
7+
8+
.Procedure
9+
. Confirm you are logged in to the {rosa-cli-first} by running the following command:
10+
+
11+
[source,terminal]
12+
----
13+
rosa whoami
14+
----
15+
+
16+
If you are logged in to the command-line interface, skip to "Creating a new project". If you are not logged in to the command-line interface, continue this procedure.
17+
18+
. Access your cluster with the web console.
19+
20+
. Click the dropdown arrow next to your login name in the upper right corner, and select *Copy Login Command*.
21+
+
22+
image::4-cli-login.png[CLI login screen]
23+
+
24+
A new tab opens.
25+
26+
. Select your authentication method.
27+
28+
. Click *Display Token*.
29+
30+
. Copy the command under *Log in with this token*.
31+
32+
. From your terminal, paste and run the copied command. If the login is successful, you will see the following confirmation message:
33+
+
34+
[source,terminal]
35+
----
36+
$ oc login --token=<your_token> --server=https://api.osd4-demo.abc1.p1.openshiftapps.com:6443
37+
Logged into "https://api.myrosacluster.abcd.p1.openshiftapps.com:6443" as "rosa-user" using the token provided.
38+
39+
You don't have any projects. You can try to create a new project, by running
40+
41+
oc new-project <project name>
42+
----
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * rosa_learning/deploying_application_workshop/learning-deploying-application-deployment.adoc
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="learning-deploying-application-deployment-viewing-application_{context}"]
6+
= Viewing the application
7+
8+
.Procedure
9+
. Copy the `ostoy-route-ostoy.apps.<your-rosa-cluster>.abcd.p1.openshiftapps.com` URL output from the previous step.
10+
. Paste the copied URL into your web browser and press enter. You should see the homepage of your application. If the page does not load, make sure you used `http` and not `https`.
11+
+
12+
image::4-ostoy-homepage.png[OStoy application homepage]
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * rosa_learning/deploying_application_workshop/learning-deploying-application-health-check.adoc
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="learning-deploying-application-health-check-crash-pod_{context}"]
6+
= Crashing the pod
7+
8+
.Procedure
9+
. From the OSToy application web console, click *Home* in the left menu, and enter a message in the *Crash Pod* box, for example, `This is goodbye!`.
10+
11+
. Click *Crash Pod*.
12+
+
13+
image::5-ostoy-crashpod.png[OSToy crash pod selection]
14+
+
15+
The pod crashes and Kubernetes restarts the pod.
16+
+
17+
image::5-ostoy-crashmsg.png[OSToy pod crash message]
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * rosa_learning/deploying_application_workshop/learning-deploying-application-health-check.adoc
4+
:_mod-docs-content-type: PROCEDURE
5+
[id="learning-deploying-application-health-check-forced-malfunction_{context}"]
6+
= Making the application malfunction
7+
8+
.Procedure
9+
10+
* From the OSToy application, click *Toggle Health* in the *Toggle Health Status* tile. Watch *Current Health* switch to *I'm not feeling all that well*.
11+
+
12+
image::5-ostoy-togglehealth.png[OSToy toggle health tile]
13+
14+
.Verification
15+
16+
After you make the application malfunction, the application stops responding with a `200 HTTP code`. After 3 consecutive failures, Kubernetes stops the pod and restarts it.
17+
18+
* From the web console, switch back to the pod events page to see that the liveness probe failed and the pod restarted.
19+
20+
The following image shows an example of what you will see on your pod events page.
21+
22+
image::5-ostoy-podevents2.png[Pod events list]
23+
24+
*A.* The pod has three consecutive failures.
25+
26+
*B.* Kubernetes stops the pod.
27+
28+
*C.* Kubernetes restarts the pod.

0 commit comments

Comments
 (0)