Skip to Content
Learn OpenShift
book

Learn OpenShift

by Denis Zuev, Artemii Kropachev, Aleksey Usov
July 2018
Intermediate to advanced
504 pages
11h 34m
English
Packt Publishing
Content preview from Learn OpenShift

Creating a route from a YAML definition

Let's create an alternate route for our application named httpd2. The route will have the myhttpd.example.com URL:

$ cat <<EOF > route-httpd2.ymlapiVersion: v1kind: Routemetadata: labels: name: httpd2 name: httpd2spec: host: myhttpd.example.com port: targetPort: 8080 to: kind: Service name: httpd weight: 100EOF

The route may be created by oc create:

$ oc create -f route-httpd2.ymlroute "httpd2" created$ oc get routeNAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARDhttpd httpd-simpleappication.127.0.0.1.nip.io httpd 8080 Nonehttpd1 httpd.example.com httpd 8080 Nonehttpd2 myhttpd.example.com httpd 8080 None

You may see that the new route has been added successfully. Now, if there is a corresponding ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Operating OpenShift

Operating OpenShift

Rick Rackow, Manuel Dewald
OpenShift for Developers, 2nd Edition

OpenShift for Developers, 2nd Edition

Joshua Wood, Brian Tannous
Kubernetes: Up and Running, 2nd Edition

Kubernetes: Up and Running, 2nd Edition

Brendan Burns, Joe Beda, Kelsey Hightower

Publisher Resources

ISBN: 9781788992329Supplemental Content