Skip to content

Commit 29a6425

Browse files
Merge pull request #34812 from chinmayi-chandrasekar/BZ1833574_missing_example_route
BZ1833574: Added a new section having an example insecure route
2 parents 19053f5 + d7bc3c7 commit 29a6425

File tree

2 files changed

+80
-0
lines changed

2 files changed

+80
-0
lines changed

modules/nw-creating-a-route.adoc

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * networking/routes/route-configuration.adoc
4+
5+
[id="nw-creating-a-route_{context}"]
6+
= Creating an HTTP-based route
7+
8+
A route allows you to host your application at a public URL. It can either be secure or unsecured, depending on the network security configuration of your application. An HTTP-based route is an unsecured route that uses the basic HTTP routing protocol and exposes a service on an unsecured application port.
9+
10+
The following procedure describes how to create a simple HTTP-based route to a web application, using the `hello-openshift` application as an example.
11+
//link:https://github.com/openshift/origin/tree/master/examples/hello-openshift[hello-openshift]
12+
13+
.Prerequisites
14+
15+
16+
* You installed the OpenShift CLI (`oc`).
17+
* You are logged in as an administrator.
18+
* You have a web application that exposes a port and a TCP endpoint listening for traffic on the port.
19+
20+
.Procedure
21+
22+
. Create a project called `hello-openshift` by running the following command:
23+
+
24+
[source,terminal]
25+
----
26+
$ oc new-project hello-openshift
27+
----
28+
29+
. Create a pod in the project by running the following command:
30+
+
31+
[source,terminal]
32+
----
33+
$ oc create -f https://raw.githubusercontent.com/openshift/origin/master/examples/hello-openshift/hello-pod.json
34+
----
35+
36+
. Create a service called `hello-openshift` by running the following command:
37+
+
38+
[source,terminal]
39+
----
40+
$ oc expose pod/hello-openshift
41+
----
42+
43+
. Create an unsecured route to the `hello-openshift` application by running the following command:
44+
+
45+
[source,terminal]
46+
----
47+
$ oc expose svc hello-openshift
48+
----
49+
+
50+
If you examine the resulting `Route` resource, it should look similar to the following:
51+
+
52+
.YAML definition of the created unsecured route:
53+
[source,yaml]
54+
----
55+
apiVersion: route.openshift.io/v1
56+
kind: Route
57+
metadata:
58+
name: hello-openshift
59+
spec:
60+
host: hello-openshift-hello-openshift.<Ingress_Domain> <1>
61+
port:
62+
targetPort: 8080
63+
to:
64+
kind: Service
65+
name: hello-openshift
66+
----
67+
<1> `<Ingress_Domain>` is the default ingress domain name.
68+
+
69+
[NOTE]
70+
====
71+
To display your default ingress domain, run the following command:
72+
[source,terminal]
73+
----
74+
$ oc get ingresses.config/cluster -o jsonpath={.spec.domain}
75+
----
76+
====

networking/routes/route-configuration.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ include::modules/common-attributes.adoc[]
77

88
toc::[]
99

10+
11+
//Creating an insecure route
12+
include::modules/nw-creating-a-route.adoc[leveloffset=+1]
13+
//
1014
//Creating route timeouts
1115
include::modules/nw-configuring-route-timeouts.adoc[leveloffset=+1]
1216

0 commit comments

Comments
 (0)