Perfect Eric, this is what exactly am looking.
I was doing same mistake as you highlighted, using the same implicit service name. Now am getting results how I want
$ oc expose svc cakephp-ex --hostname=alias1.example.com --name alias1
route "alias1" exposed
$ oc expose svc cakephp-ex --hostname=alias2.example.com --name alias2
route "alias2” exposed
$ oc get routes
NAME HOST/PORT PATH SERVICE LABELS INSECURE POLICY TLS TERMINATION
alias1 alias1.example.com cakephp-ex app=cakephp-ex
alias2 alias2.example.com cakephp-ex app=cakephp-ex
Thank you, appreciated.
From: Erik Jacobs <ejacobs redhat com>
Date: Wednesday, January 20, 2016 at 12:07 PM
To: skotaru <skotaru cisco com>
Cc: "bleanhar redhat com" <bleanhar redhat com>, Dale Bewley <dale bewley net>, "users lists openshift redhat com" <users lists openshift redhat com>, dev <dev lists openshift redhat com>
Subject: Re: routing/vhost alias
Can you show where you were unable to create multiple routes for the same service? I have been able to use "oc expose" on the same service multiple times. You need to take care to use the --name attribute to give the new route a unique ID/name.
For example, given a service "foo":
oc expose foo --hostname=alias1.somedomain.com
oc expose foo --hostname=alias2.otherdomain.com
The 2nd expose will fail because it will try to create another route called "foo" (an ID of foo, which is not unique since a route already exists with that name/id).
You would need to do:
oc expose foo --hostname=alias2.otherdomain.com --name=foo2
I hope this helps!
Erik M Jacobs, RHCA
Principal Technical Marketing Manager, OpenShift Enterprise
Red Hat, Inc.
Email: ejacobs redhat com
AOL Instant Messenger: ejacobsatredhat
On Wed, Jan 20, 2016 at 1:19 PM, Srinivas Naga Kotaru (skotaru) <skotaru cisco com> wrote: