Skip to content

Commit 5b45d5a

Browse files
authored
Merge pull request #90215 from bergerhoffer/OSDOCS-13467-tutorial
OSDOCS:13467: Creating new tutorial book and updating CLI tutorial
2 parents 0f4c523 + 810d921 commit 5b45d5a

26 files changed

+443
-473
lines changed

_topic_maps/_topic_map.yml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,16 @@ Topics:
5959
- Name: Additional release notes
6060
File: addtl-release-notes
6161
---
62-
Name: Getting started
63-
Dir: getting_started
62+
Name: Tutorials
63+
Dir: tutorials
6464
Distros: openshift-enterprise
6565
Topics:
66-
- Name: Kubernetes overview
67-
File: kubernetes-overview
68-
- Name: OpenShift Container Platform overview
69-
File: openshift-overview
70-
- Name: Web console walkthrough
71-
File: openshift-web-console
72-
- Name: Command-line walkthrough
73-
File: openshift-cli
66+
# - Name: Tutorials overview
67+
# File: index
68+
- Name: Deploying an application by using the web console
69+
File: dev-app-web-console
70+
- Name: Deploying an application by using the CLI
71+
File: dev-app-cli
7472
---
7573
Name: Architecture
7674
Dir: architecture

getting_started/accessing-your-services.adoc

Lines changed: 0 additions & 30 deletions
This file was deleted.

getting_started/dedicated-networking.adoc

Lines changed: 0 additions & 10 deletions
This file was deleted.

getting_started/deleting-your-cluster.adoc

Lines changed: 0 additions & 16 deletions
This file was deleted.

getting_started/openshift-cli.adoc

Lines changed: 0 additions & 84 deletions
This file was deleted.

getting_started/scaling-your-cluster.adoc

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,41 @@
11
// Module included in the following assemblies:
22
//
3-
// * getting-started/openshift-cli.adoc
3+
// * tutorials/dev-app-cli.adoc
44

55
:_mod-docs-content-type: PROCEDURE
66
[id="getting-started-cli-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 must have access to an {product-title} cluster.
15-
* You must have installed the OpenShift CLI (`oc`).
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-
* To connect to a database, enter the following command:
18+
* Deploy the `mongodb-nationalparks` database application by running the following command:
2119
+
2220
[source,terminal]
2321
----
24-
$ oc new-app quay.io/centos7/mongodb-36-centos7:master --name mongodb-nationalparks -e MONGODB_USER=mongodb -e MONGODB_PASSWORD=mongodb -e MONGODB_DATABASE=mongodb -e MONGODB_ADMIN_PASSWORD=mongodb -l 'app.kubernetes.io/part-of=national-parks-app,app.kubernetes.io/name=mongodb'
22+
$ oc new-app registry.redhat.io/rhmap47/mongodb --name mongodb-nationalparks -e MONGODB_USER=mongodb -e MONGODB_PASSWORD=mongodb -e MONGODB_DATABASE=mongodb -e MONGODB_ADMIN_PASSWORD=mongodb -l 'app.kubernetes.io/part-of=national-parks-app,app.kubernetes.io/name=mongodb'
2523
----
2624
+
2725
.Example output
2826
+
29-
[source,terminal]
27+
[source,text]
3028
----
31-
--> Found container image dc18f52 (3 years old) from quay.io for "quay.io/centos7/mongodb-36-centos7:master"
32-
33-
MongoDB 3.6
34-
-----------
35-
MongoDB (from humongous) is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. This container image contains programs to run mongod server.
36-
37-
Tags: database, mongodb, rh-mongodb36
29+
--> Found container image 7a61087 (12 days old) from quay.io for "quay.io/mongodb/mongodb-enterprise-server"
3830
39-
* An image stream tag will be created as "mongodb-nationalparks:master" that will track this image
31+
* An image stream tag will be created as "mongodb-nationalparks:latest" that will track this image
4032
4133
--> Creating resources with label app.kubernetes.io/name=mongodb,app.kubernetes.io/part-of=national-parks-app ...
4234
imagestream.image.openshift.io "mongodb-nationalparks" created
4335
deployment.apps "mongodb-nationalparks" created
4436
service "mongodb-nationalparks" created
4537
--> Success
38+
Application is not exposed. You can expose services to the outside world by executing one or more of the commands below:
39+
'oc expose service/mongodb-nationalparks'
40+
Run 'oc status' to view your app.
4641
----
Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
11
// Module included in the following assemblies:
22
//
3-
// * getting-started/openshift-cli.adoc
3+
// * tutorials/dev-app-cli.adoc
44

55
:_mod-docs-content-type: PROCEDURE
66
[id="getting-started-cli-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.
1414

1515
.Prerequisites
1616

17-
* You must have access to an {product-title} cluster.
18-
* You must have installed the OpenShift CLI (`oc`).
17+
* You have access to an {product-title} cluster.
18+
* You have installed the OpenShift CLI (`oc`).
1919
2020
.Procedure
2121

22-
* To create a new project, enter the following command:
22+
* Create a project by running the following command:
2323
+
2424
[source,terminal]
2525
----
26-
$ oc new-project user-getting-started --display-name="Getting Started with OpenShift"
26+
$ oc new-project user-getting-started
2727
----
2828
+
2929
.Example output
3030
3131
[source,terminal]
3232
----
3333
Now using project "user-getting-started" on server "https://openshift.example.com:6443".
34+
...
3435
----
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * tutorials/dev-app-cli.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
[id="getting-started-cli-creating-route-backend_{context}"]
7+
= Exposing the back-end service
8+
9+
Similar to how you exposed the front-end service for external clients, you must now expose the back-end service by creating a route.
10+
11+
.Prerequisites
12+
13+
* You have deployed the `nationalparks` back-end application.
14+
* You have `cluster-admin` or project-level `admin` privileges.
15+
16+
.Procedure
17+
18+
. Create a route to expose the `nationalparks` back-end application by running the following command:
19+
+
20+
[source,terminal]
21+
----
22+
$ oc create route edge nationalparks --service=nationalparks
23+
----
24+
25+
. Label the `nationalparks` route by running the following command:
26+
+
27+
[source,terminal]
28+
----
29+
$ oc label route nationalparks type=parksmap-backend
30+
----
31+
+
32+
The application code expects the `nationalparks` route to be labeled with `type=parksmap-backend`.

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

Lines changed: 12 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,39 @@
11
// Module included in the following assemblies:
22
//
3-
// * getting-started/openshift-cli.adoc
3+
// * tutorials/dev-app-cli.adoc
44

55
:_mod-docs-content-type: PROCEDURE
66
[id="getting-started-cli-creating-route_{context}"]
7-
= Creating a route
7+
= Exposing the front-end service
88

9-
External clients can access applications running on {product-title} through the routing layer and the data object behind that is a _route_. The default {product-title} router (HAProxy) uses the HTTP header of the incoming request to determine where to proxy the connection.
9+
By default, services running on {product-title} are not accessible externally.
10+
11+
To expose your service so that external clients can access it, you can create a _route_. A `Route` object is a {product-title} networking resource similar to a Kubernetes `Ingress` object. The default {product-title} router (HAProxy) uses the HTTP header of the incoming request to determine where to proxy the connection.
1012

1113
Optionally, you can define security, such as TLS, for the route.
1214

1315
.Prerequisites
1416

15-
* You must have access to an {product-title} cluster.
16-
* You must have installed the OpenShift CLI (`oc`).
17-
* You have a deployed image.
18-
* You must have `cluster-admin` or `project-admin` privileges.
17+
* You have deployed the `parksmap` front-end application.
18+
* You have `cluster-admin` or project-level `admin` privileges.
1919
2020
.Procedure
2121

22-
. To retrieve the created application service, enter the following command:
23-
+
24-
[source,terminal]
25-
----
26-
$ oc get service
27-
----
28-
+
29-
.Example output
30-
+
31-
[source,terminal]
32-
----
33-
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
34-
parksmap ClusterIP <your-cluster-IP> <123.456.789> 8080/TCP 8m29s
35-
----
22+
* Create a route to expose the `parksmap` front-end application by running the following command:
3623
37-
. To create a route, enter the following command:
3824
+
3925
[source,terminal]
4026
----
4127
$ oc create route edge parksmap --service=parksmap
4228
----
43-
+
44-
.Example output
45-
+
46-
[source,terminal]
47-
----
48-
route.route.openshift.io/parksmap created
49-
----
5029

51-
. To retrieve the created application route, enter the following command:
30+
.Verification
31+
32+
* Verify that the application route was successfully created by running the following command:
5233
+
5334
[source,terminal]
5435
----
55-
$ oc get route
36+
$ oc get route parksmap
5637
----
5738
+
5839
.Example output

0 commit comments

Comments
 (0)