- Create a Service to expose your pods inside the cluster (ClusterIP).
- Create a Route to expose that Service externally (HTTP/HTTPS).
- Verify the application via the ClusterIP (internal) and the Route (external).
Create a Service (internal exposure)
If your builds and deployments are already configured, the next step is to create a Service to make your application reachable from other pods and services inside the cluster. Start by getting a Service YAML template (for example, via the OpenShift console “Learn More” / “Import YAML” option). Create a file namedservice-config.yaml and paste the template into it. An initial template might look like this:
Update the selector and ports to match your application (in this example the app listens on port
8080). Remove the clusterIP field so OpenShift assigns it automatically:
- Via the OpenShift web console: choose Import YAML or JSON, paste
service-config.yaml, and click Create. - Or via CLI:
oc apply -f service-config.yaml

172.30.163.74). This IP is reachable only from inside the cluster network — not from the public internet.
ClusterIP Services are internal to the cluster. To be reachable from outside the cluster you need to expose the Service using a Route (on OpenShift) or use a
NodePort/LoadBalancer Service type depending on your environment.Create a Route (external exposure)
To make the Service accessible to external HTTP(S) clients, create an OpenShift Route. You can create Routes via YAML (same approach as Services) or from the web console. Here we’ll use the console: click Create Route. The Create Route form allows you to set the route name, hostname, path, service, and target port. If you leave the hostname blank, OpenShift will generate a hostname for you.
If you specify a custom hostname (for example
www.example.com), ensure your external DNS points that hostname to the OpenShift router. Once traffic reaches the cluster, Routes direct it to the correct Service based on hostname/path.
Quick reference and commands
- Create a Service:
- Console: Import YAML / Create → paste YAML → Create
- CLI:
oc apply -f service-config.yaml
- Verify Service:
oc get svcoc describe svc simple-webapp-docker
- Create a Route:
- Console: Applications → Routes → Create Route
- CLI example:
oc expose svc/simple-webapp-docker --hostname=your.host.example.com