July 2018
Intermediate to advanced
504 pages
11h 34m
English
You can create a route using oc expose in the following way:
$ oc expose svc httpdroute "httpd" exposed$ oc get routeNAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARDhttpd httpd-simpleappication.127.0.0.1.nip.io httpd 8080 None$ curl -s http://httpd-simpleappication.127.0.0.1.nip.io | head -n 4<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head>$ oc delete route httpdroute "httpd" deleted
You may want to create a route with an alternate URL, using the --hostname option:
$ oc expose svc httpd --name httpd1 --hostname ...