1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-05 21:46:22 +01:00
Files
openshift-docs/modules/getting-started-cli-creating-route.adoc
2022-02-23 12:17:44 -05:00

70 lines
1.9 KiB
Plaintext

// Module included in the following assemblies:
//
// * getting-started/openshift-cli.adoc
:_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
----
[role="_additional-resources"]
.Additional resources
* xref:../cli_reference/openshift_cli/developer-cli-commands.adoc#oc-create-route-edge[oc create route edge]
* xref:../cli_reference/openshift_cli/developer-cli-commands.adoc#oc-get[oc get]