Skip to content

Commit 666dad7

Browse files
authored
Merge pull request #91212 from bergerhoffer/OSDOCS-13254-web-tutorial
OSDOCS#13454: Updates to the web console tutorial
2 parents 7e19b7e + c3874ae commit 666dad7

22 files changed

+303
-267
lines changed

images/fa-plus-circle.png

439 Bytes
Loading
-15.4 KB
Loading
24.1 KB
Loading
-35.6 KB
Loading

modules/getting-started-cli-creating-new-project.adoc

+6-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,14 @@ Cluster administrators can allow developers to create their own projects. In mos
1212

1313
This procedure creates a new project called `user-getting-started`. You will use this project throughout the rest of this tutorial.
1414

15+
[IMPORTANT]
16+
====
17+
If you are using Developer Sandbox to complete this tutorial, skip this procedure. A project has already been created for you.
18+
====
19+
1520
.Prerequisites
1621

17-
* You have access to an {product-title} cluster.
18-
* You have installed the OpenShift CLI (`oc`).
22+
* You have logged in to the {oc-first}.
1923
2024
.Procedure
2125

modules/getting-started-cli-creating-secret.adoc

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
[id="getting-started-cli-creating-secret_{context}"]
77
= Providing access to the database by creating a secret
88

9-
The `nationalparks` application needs information, such as the database name, username, and passwords, on how to access the MongoDB database. However, because this information is sensitive, you should not store it directly in the pod.
9+
The `nationalparks` application needs information, such as the database name, username, and passwords, to access the MongoDB database. However, because this information is sensitive, you should not store it directly in the pod.
1010

1111
You can use a _secret_ to store sensitive information, and share that secret with workloads.
1212

13-
`Secret` objects provide a mechanism to hold sensitive information such as passwords, {product-title} client configuration files, private source repository credentials, and so on. Secrets decouple sensitive content from the pods. You can mount secrets into containers by using a volume plugin, or the system can use secrets to perform actions on behalf of a pod.
13+
`Secret` objects provide a mechanism to hold sensitive information such as passwords, {product-title} client configuration files, and private source repository credentials. Secrets decouple sensitive content from the pods. You can mount secrets into containers by using a volume plugin or by passing the secret in as an environment variable. The system can then use secrets to provide the pod with the sensitive information.
1414

1515
The following procedure creates the `nationalparks-mongodb-parameters` secret and mounts it to the `nationalparks` workload.
1616

modules/getting-started-cli-granting-permissions.adoc

+5
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,8 @@ As a requirement of the application, you must assign the `view` role to the `def
2626
----
2727
$ oc adm policy add-role-to-user view -z default -n user-getting-started
2828
----
29+
+
30+
[IMPORTANT]
31+
====
32+
If you are using a different project, replace `user-getting-started` with the name of your project.
33+
====

modules/getting-started-cli-login.adoc

-38
This file was deleted.

modules/getting-started-cli-view.adoc

+6-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ NAME HOST/PORT PATH SER
3434
parksmap parksmap-user-getting-started.apps.cluster.example.com parksmap 8080-tcp edge None
3535
----
3636

37-
. From the above output, copy the value in the `HOST/PORT` column. Because the route is a secured route, you must add `https://` in front to get the application URL.
37+
. From the above output, copy the value in the `HOST/PORT` column.
38+
39+
. Add `https://` in front of the copied value to get the application URL. This is necessary because the route is a secured route.
3840
+
3941
.Example application URL
4042
[source,text]
@@ -45,4 +47,6 @@ https://parksmap-user-getting-started.apps.cluster.example.com
4547
. Paste this application URL into your web browser. Your browser should display a map of the national parks across the world.
4648
+
4749
.National parks across the world
48-
image::getting-started-map-national-parks.png[A map of the national parks across the world is displayed with location tracking.]
50+
image::getting-started-map-national-parks.png[Map of the national parks across the world]
51+
+
52+
If you allow the application to access your location, the map will center on your location.
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,30 @@
11
// Module included in the following assemblies:
22
//
3-
// * getting-started/openshift-web-console.adoc
3+
// * tutorials/dev-app-web-console.adoc
44

55
:_mod-docs-content-type: PROCEDURE
66
[id="getting-started-web-console-connecting-database_{context}"]
7-
= Connecting to a database
7+
= Deploying the database application
88

9-
Deploy and connect a MongoDB database where the `national-parks-app` application stores location information.
10-
Once you mark the `national-parks-app` application as a backend for the map visualization tool, `parksmap` deployment uses the {product-title} discover mechanism to display the map automatically.
9+
The following procedure deploys `mongodb-nationalparks`, which is a MongoDB database that will hold the national park location information.
1110

1211
.Prerequisites
1312

14-
* You are logged in to the {product-title} web console.
15-
* You are in the *Developer* perspective.
16-
* You have a deployed image.
13+
* You have deployed the `parksmap` front-end application.
14+
* You have deployed the `nationalparks` back-end application.
1715
1816
.Procedure
1917

20-
. From the *+Add* view in the *Developer* perspective, click *Container images* to open a dialog.
21-
. In the *Image Name* field, enter `quay.io/centos7/mongodb-36-centos7`.
22-
. In the *Runtime icon* field, search for `mongodb`.
23-
. Scroll down to the *General* section.
24-
. Ensure that you have the current values for the following:
25-
.. Application: `national-parks-app`
26-
.. Name: `mongodb-nationalparks`
27-
. Select *Deployment* as the *Resource*.
28-
. Unselect the checkbox next to *Create route to the application*.
29-
. In the *Advanced Options* section, click *Deployment* to add environment variables to add the following environment variables:
18+
. From the *Quick create* (image:fa-plus-circle.png[title="Quick create menu"]) menu in the upper right corner, click *Container images*.
19+
. Select *Image name from external registry* and enter `registry.redhat.io/rhmap47/mongodb`.
20+
. In the *Runtime icon* field, search for and select `mongodb`.
21+
. Scroll to the *General* section.
22+
. In the *Application name* field, enter `national-parks-app`.
23+
. In the *Name* field, enter `mongodb-nationalparks`.
24+
. Scroll to the *Deploy* section.
25+
. In the *Resource type* field, ensure that *Deployment* is selected.
26+
. Click *Show advanced Deployment option*.
27+
. Under *Environment variables (runtime only)*, add the following names and values:
3028
+
3129
.Environment variable names and values
3230
[cols="1,1"]
@@ -38,5 +36,16 @@ Once you mark the `national-parks-app` application as a backend for the map visu
3836
|`MONGODB_DATABASE`|`mongodb`
3937
|`MONGODB_ADMIN_PASSWORD`|`mongodb`
4038
|===
39+
+
40+
[TIP]
41+
====
42+
Click *Add value* to add each additional environment variable.
43+
====
44+
45+
. In the *Advanced options* section, clear *Create a route*.
46+
+
47+
The database application does not need to be accessed externally, so a route is not required.
4148

4249
. Click *Create*.
50+
51+
You are redirected to the *Topology* page where you can see the `mongodb-nationalparks` deployment in the `national-parks-app` application.
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,29 @@
11
// Module included in the following assemblies:
22
//
3-
// * getting-started/openshift-web-console.adoc
3+
// * tutorials/dev-app-web-console.adoc
44

55
:_mod-docs-content-type: PROCEDURE
66
[id="getting-started-web-console-creating-new-project_{context}"]
7-
= Creating a new project
7+
= Creating a project
88

9-
A project enables a community of users to organize and manage their content in isolation. Projects are {product-title} extensions to Kubernetes namespaces. Projects have additional features that enable user self-provisioning.
9+
A _project_ enables a community of users to organize and manage their content in isolation. Projects are {product-title} extensions to Kubernetes namespaces. Projects have additional features that enable user self-provisioning. Each project has its own set of objects, policies, constraints, and service accounts.
1010

11-
Users must receive access to projects from administrators. Cluster administrators can allow developers to create their own projects. In most cases, users automatically have access to their own projects.
11+
Cluster administrators can allow developers to create their own projects. In most cases, you automatically have access to your own projects. Administrators can grant access to other projects as needed.
1212

13-
Each project has its own set of objects, policies, constraints, and service accounts.
13+
This procedure creates a new project called `user-getting-started`. You will use this project throughout the rest of this tutorial.
14+
15+
[IMPORTANT]
16+
====
17+
If you are using Developer Sandbox to complete this tutorial, skip this procedure. A project has already been created for you.
18+
====
1419

1520
.Prerequisites
1621

17-
* You are logged in to the {product-title} web console.
18-
* You are in the *Developer* perspective.
19-
* You have the appropriate roles and permissions in a project to create applications and other workloads in {product-title}.
22+
* You have logged in to the {product-title} web console.
2023
2124
.Procedure
2225

23-
. In the *+Add* view, select *Project* -> *Create Project*.
26+
. Navigate to *Home* -> *Projects*.
27+
. Click *Create Project*.
2428
. In the *Name* field, enter `user-getting-started`.
25-
. Optional: In the *Display name* field, enter `Getting Started with OpenShift`.
26-
+
27-
[NOTE]
28-
====
29-
*Display name* and *Description* fields are optional.
30-
====
3129
. Click *Create*.
32-
33-
You have created your first project on {product-title}.
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,52 @@
11
// Module included in the following assemblies:
22
//
3-
// * getting-started/openshift-web-console.adoc
3+
// * tutorials/dev-app-web-console.adoc
44

55
:_mod-docs-content-type: PROCEDURE
66
[id="getting-started-web-console-creating-secret_{context}"]
7-
= Creating a secret
7+
= Providing access to the database by creating a secret
88

9-
The `Secret` object provides a mechanism to hold sensitive information such as passwords, {product-title} client configuration files, private source repository credentials, and so on.
10-
Secrets decouple sensitive content from the pods. You can mount secrets into containers using a volume plugin or the system can use secrets to perform actions on behalf of a pod.
11-
The following procedure adds the secret `nationalparks-mongodb-parameters` and mounts it to the `nationalparks` workload.
9+
The `nationalparks` application needs information, such as the database name, username, and passwords, to access the MongoDB database. However, because this information is sensitive, you should not store it directly in the pod.
10+
11+
You can use a _secret_ to store sensitive information, and share that secret with workloads.
12+
13+
`Secret` objects provide a mechanism to hold sensitive information such as passwords, {product-title} client configuration files, and private source repository credentials. Secrets decouple sensitive content from the pods. You can mount secrets into containers by using a volume plugin or by passing the secret in as an environment variable. The system can then use secrets to provide the pod with the sensitive information.
14+
15+
The following procedure creates the `nationalparks-mongodb-parameters` secret and mounts it to the `nationalparks` workload.
1216

1317
.Prerequisites
1418

15-
* You are logged in to the {product-title} web console.
16-
* You are in the *Developer* perspective.
17-
* You have a deployed image.
19+
* You have deployed the `nationalparks` back-end application.
20+
* You have deployed the `mongodb-nationalparks` database application.
1821
1922
.Procedure
2023

21-
. From the *Developer* perspective, navigate to *Secrets* on the left hand navigation and click *Secrets*.
24+
. Navigate to *Workloads* -> *Secrets*.
2225
. Click *Create* -> *Key/value secret*.
23-
.. In the *Secret name* field, enter `nationalparks-mongodb-parameters`.
24-
.. Enter the following values for *Key* and *Value*:
26+
. In the *Secret name* field, enter `nationalparks-mongodb-parameters`.
27+
. Enter the following values for *Key* and *Value*:
2528
+
2629
.Secret keys and values
2730
[cols="1,1"]
2831
|===
2932
|Key |Value
3033

31-
|`MONGODB_USER`|`mongodb`
3234
|`DATABASE_SERVICE_NAME`|`mongodb-nationalparks`
35+
|`MONGODB_USER`|`mongodb`
3336
|`MONGODB_PASSWORD`|`mongodb`
3437
|`MONGODB_DATABASE`|`mongodb`
3538
|`MONGODB_ADMIN_PASSWORD`|`mongodb`
3639
|===
40+
+
41+
[TIP]
42+
====
43+
Click *Add key/value* to add each additional key/value pair.
44+
====
3745

38-
.. Click *Create*.
46+
. Click *Create*.
3947
. Click *Add Secret to workload*.
40-
.. From the drop down menu, select `nationalparks` as the workload to add.
41-
.. Click *Save*.
48+
. From the *Add this secret to workload* list, select `nationalparks`.
49+
50+
. Click *Save*.
4251

4352
This change in configuration triggers a new rollout of the `nationalparks` deployment with the environment variables properly injected.
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,38 @@
11
// Module included in the following assemblies:
22
//
3-
// * getting-started/openshift-web-console.adoc
3+
// * tutorials/dev-app-web-console.adoc
44

55
:_mod-docs-content-type: PROCEDURE
66
[id="getting-started-web-console-deploying-first-image_{context}"]
7-
= Deploying your first image
7+
= Deploying the front-end application
88

9-
The simplest way to deploy an application in {product-title} is to run an existing container image. The following procedure deploys a front end component of an application called `national-parks-app`. The web application displays an interactive map. The map displays the location of major national parks across the world.
9+
The simplest way to deploy an application in {product-title} is to run a provided container image.
1010

11-
.Prerequisites
12-
13-
* You are logged in to the {product-title} web console.
14-
* You are in the *Developer* perspective.
15-
* You have the appropriate roles and permissions in a project to create applications and other workloads in {product-title}.
11+
The following procedure deploys `parksmap`, which is the front-end component of the `national-parks-app` application. The web application displays an interactive map of the locations of national parks across the world.
1612

1713
.Procedure
1814

19-
. From the *+Add* view in the *Developer* perspective, click *Container images* to open a dialog.
20-
. In the *Image Name* field, enter the following: `quay.io/openshiftroadshow/parksmap:latest`
21-
. Ensure that you have the current values for the following:
22-
.. Application: `national-parks-app`
23-
.. Name: `parksmap`
24-
. Select *Deployment* as the *Resource*.
25-
. Select *Create route to the application*.
26-
. In the *Advanced Options* section, click *Labels* and add labels to better identify this deployment later. Labels help identify and filter components in the web console and in the command line. Add the following labels:
15+
. From the *Quick create* (image:fa-plus-circle.png[title="Quick create menu"]) menu in the upper right corner, click *Container images*.
16+
. Select *Image name from external registry* and enter `quay.io/openshiftroadshow/parksmap:latest`.
17+
. Scroll to the *General* section.
18+
. In the *Application name* field, enter `national-parks-app`.
19+
. In the *Name* field, ensure that the value is `parksmap`.
20+
. Scroll to the *Deploy* section.
21+
. In the *Resource type* field, ensure that *Deployment* is selected.
22+
. In the *Advanced options* section, ensure that *Create a route* is selected.
23+
+
24+
By default, services running on {product-title} are not accessible externally. You must select this option to create a route so that external clients can access your service.
25+
26+
. Click the *Labels* hyperlink.
27+
+
28+
The application code requires certain labels to be set.
29+
30+
. Add the following labels to the text area and press Enter after each key/value pair:
31+
2732
** `app=national-parks-app`
2833
** `component=parksmap`
2934
** `role=frontend`
35+
3036
. Click *Create*.
3137

3238
You are redirected to the *Topology* page where you can see the `parksmap` deployment in the `national-parks-app` application.

0 commit comments

Comments
 (0)