liveBook · Manning

Route

As explained in Quarkus in Action

A Route is an OpenShift resource that exposes a service to external clients through a hostname and network route.

A Route is an OpenShift resource that makes a Service reachable from outside the cluster through a public URL. It serves a different purpose from the Service hostname that deployments use to call one another inside OpenShift. section 11.3.4 section 11.6.3

To expose a Quarkus service during deployment:

  • Add the quarkus-openshift extension and set `quarkus.openshift.route.expose=true` in `application.properties`. section 11.3.4 section 11.6.3
  • Build and apply the generated `openshift.yml`, then run `oc get routes` to find the assigned host and the Service it targets. section 11.3.4
  • Use Service names, not public routes or `localhost`, for calls between deployed services. A browser-facing Keycloak redirect needs Keycloak’s public route instead. section 11.6.3

Inventory service

After deploying the Inventory service, `oc get routes` shows its host and the `inventory-service` target. Open that host with `/q/graphql-ui` to reach the deployed UI. The example route uses HTTP because SSL was not configured; check the route’s scheme rather than assuming HTTPS. section 11.3.4

# Remove the Kubernetes configuration from the previous section
-quarkus.kubernetes.env.vars.quarkus-datasource-jdbc-url=
jdbc:mysql://mysql:3306/inventory
-quarkus.kubernetes.prometheus.generate-service-monitor=false
-quarkus.kubernetes.namespace=default

quarkus.openshift.env.vars.quarkus-datasource-jdbc-url=
jdbc:mysql://mysql:3306/inventory

quarkus.openshift.prometheus.generate-service-monitor=false

# Expose created service to the world
quarkus.openshift.route.expose=true

The OpenShift properties enable Route creation alongside the Inventory service’s database and monitoring settings. section 11.3.4

How Quarkus in Action covers it

How deep it goes
Shows configuration, deployment, and route verification, but does not detail Route resource fields or configure SSL.
Examples
Uses an Inventory service route and `/q/graphql-ui`, then public routes across a car-rental deployment.
What it assumes
Assumes a Quarkus service being deployed to OpenShift and distinguishes external routes from internal Service hostnames.
What you can do after
Operate/configure it with `quarkus.openshift.route.expose=true` and verify the assigned host using `oc get routes`.
How it connects
Connects Routes to OpenShift Services, Quarkus deployment manifests, and browser-facing Keycloak redirects.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Quarkus in Action. The section links point to the parts of the book it draws on.