:_mod-docs-content-type: ASSEMBLY
[id="ossm-routing-traffic"]
= Managing traffic in your service mesh
include::_attributes/common-attributes.adoc[]
:context: traffic-management

toc::[]

Using {SMProductName}, you can control the flow of traffic and API calls between services. Some services in your service mesh might need to communicate within the mesh and others might need to be hidden. You can manage the traffic to hide specific backend services, expose services, create testing or versioning deployments, or add a security layer on a set of services.

include::modules/ossm-gateways.adoc[leveloffset=+1]

// Hiding in ROSA/OSD, dedicated-admin cannot create "services" or "deployments"
ifndef::openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]

include::modules/ossm-automatic-gateway-injection.adoc[leveloffset=+2]

include::modules/ossm-deploying-automatic-gateway-injection.adoc[leveloffset=+2]
endif::openshift-rosa,openshift-rosa-hcp,openshift-dedicated[]

include::modules/ossm-routing-ingress.adoc[leveloffset=+2]

ifdef::openshift-enterprise[]
[role="_additional-resources"]
.Additional resources

* xref:../../networking/configuring_network_settings/configuring-node-port-service-range.adoc#configuring-node-port-service-range[Configuring the node port service range]
endif::[]

include::modules/ossm-routing-gateways.adoc[leveloffset=+2]

[id="ossm-auto-route_{context}"]
== Understanding automatic routes

:FeatureName: Istio OpenShift Routing (IOR)
include::modules/deprecated-feature.adoc[leveloffset=+1]

OpenShift routes for gateways are automatically managed in {SMProductShortName}. Every time an Istio Gateway is created, updated or deleted inside the service mesh, an OpenShift route is created, updated or deleted.

[NOTE]
====
Starting with {SMProductShortName} 2.5, automatic routes are disabled by default for new instances of the `ServiceMeshControlPlane` resource.
====

[id="ossm-auto-route-subdomains_{context}"]
=== Routes with subdomains

{SMProductName} creates the route with the subdomain, but {product-title} must be configured to enable it. Subdomains, for example `*.domain.com`, are supported, but not by default. Configure an {product-title} wildcard policy before configuring a wildcard host gateway.

ifdef::openshift-enterprise[]
For more information, see "Using wildcard routes" in xref:../../networking/networking_operators/ingress-operator.adoc#using-wildcard-routes[Ingress Operator in {product-title}].
endif::[]

include::modules/ossm-auto-route.adoc[leveloffset=+2]

include::modules/ossm-auto-route-annotations.adoc[leveloffset=+2]

ifdef::openshift-enterprise[]
.Additional resources
* xref:../../networking/ingress_load_balancing/routes/nw-configuring-routes.adoc#nw-route-specific-annotations[Route-specific annotations].
endif::[]

include::modules/ossm-auto-route-enable.adoc[leveloffset=+2]

include::modules/ossm-routing-service-entries.adoc[leveloffset=+1]

include::modules/ossm-routing-virtual-service.adoc[leveloffset=+1]

include::modules/ossm-routing-destination-rules.adoc[leveloffset=+1]

include::modules/ossm-networkpolicy-overview.adoc[leveloffset=+1]

include::modules/ossm-config-disable-networkpolicy.adoc[leveloffset=+2]

include::modules/ossm-routing-sidecar.adoc[leveloffset=+1]

== Routing Tutorial

This guide references the Bookinfo sample application to provide examples of routing in an example application. Install the xref:../../service_mesh/v2x/prepare-to-deploy-applications-ossm.adoc#ossm-tutorial-bookinfo-overview_ossm-create-mesh[Bookinfo application] to learn how these routing examples work.

include::modules/ossm-routing-bookinfo-example.adoc[leveloffset=+2]

include::modules/ossm-routing-bookinfo-applying.adoc[leveloffset=+2]

include::modules/ossm-routing-bookinfo-test.adoc[leveloffset=+2]

include::modules/ossm-routing-bookinfo-route.adoc[leveloffset=+2]
