OpenShift has an elegant way of exposing a service so that it can be accessed from the outside of an OpenShift cluster. This resource is called a router in OpenShift. OpenShift provides an external hostname mapping to a load balancer that distributes traffic among OpenShift services:
OpenShift router workflow
In order for the OpenShift router to load balance external traffic, it has to use HTTP or HTTPS protocol, and be resolvable by DNS using DNS wildcards.
Let's expose our service outside of the OpenShift cluster by running the oc expose command with additional parameters:
$ oc expose service/ruby-ex-1-zzhrc --hostname="openshiftdemo.local"
Check the list of routes:
$ oc get routes
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
ruby-ex-1-zzhrc openshiftdemo.local ruby-ex-1-zzhrc 8080 None
If we try to run the...