mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 21:46:22 +01:00
65 lines
1.7 KiB
Plaintext
65 lines
1.7 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
// * getting-started/openshift-cli.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="getting-started-cli-creating-route_{context}"]
|
|
= Creating a route
|
|
|
|
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.
|
|
|
|
Optionally, you can define security, such as TLS, for the route.
|
|
|
|
.Prerequisites
|
|
|
|
* You must have access to an {product-title} cluster.
|
|
* You must have installed the OpenShift CLI (`oc`).
|
|
* You have a deployed image.
|
|
* You must have `cluster-admin` or `project-admin` privileges.
|
|
|
|
.Procedure
|
|
|
|
. To retrieve the created application service, enter the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get service
|
|
----
|
|
+
|
|
.Example output
|
|
+
|
|
[source,terminal]
|
|
----
|
|
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
|
|
parksmap ClusterIP <your-cluster-IP> <123.456.789> 8080/TCP 8m29s
|
|
----
|
|
|
|
. To create a route, enter the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc create route edge parksmap --service=parksmap
|
|
----
|
|
+
|
|
.Example output
|
|
+
|
|
[source,terminal]
|
|
----
|
|
route.route.openshift.io/parksmap created
|
|
----
|
|
|
|
. To retrieve the created application route, enter the following command:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ oc get route
|
|
----
|
|
+
|
|
.Example output
|
|
+
|
|
[source,terminal]
|
|
----
|
|
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
|
|
parksmap parksmap-user-getting-started.apps.cluster.example.com parksmap 8080-tcp edge None
|
|
----
|