[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: routing/vhost alias



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. 

-- 
Srinivas Kotaru

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

Hi Srinivas,

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.
Phone: 646.462.3745
AOL Instant Messenger: ejacobsatredhat
Twitter: @ErikonOpen
Freenode: thoraxe

On Wed, Jan 20, 2016 at 1:19 PM, Srinivas Naga Kotaru (skotaru) <skotaru cisco com> wrote:
Brenton

That part I understood however I was not able to create one then one route for a service. So is it expected behavior to have more than one service if I want to have more than one route/alias for same application?


--
Srinivas Kotaru







On 1/20/16, 6:02 AM, "Brenton Leanhardt" <bleanhar redhat com> wrote:

>On Wed, Jan 20, 2016 at 2:29 AM, Srinivas Naga Kotaru (skotaru)
><skotaru cisco com> wrote:
>> Dale
>>
>> Thanks for reply. Am aware of this command but am not sure this is what am
>> looking
>>
>> We have 2 URL for every application. 1st one is generated by openshift
>> router and 2nd one client generated. Client generated URL simple a pointer
>> to our DMZ reverse proxy servers. Once initial traffic landed in DMZ and
>> proper security filtering, proxied back to openshift url.
>>
>> For this setup to work, openshift side should have an alias which is
>> matching 1st URL for routing to work. In case of apache, it was done using
>> vhost server alias mechanism. Since 3.x use HAProxy based router, am
>> thinking we should have equivalent setup by matching Host header of 1st URL.
>> At this moment HAProxy Router has ACL which are matching 2nd openshift Host
>> Header.  Without ACL entry matching 1st URL, HAProxy won’t be abel to proxy
>> to end points.  You will get 503 error etc unless we do a Host header
>> conversion from 1st URL to 2nd at RP layer.
>>
>> Hope it helps.
>
>Hi Srinivas,
>
>To achieve the same result as the 'alias' command from 2.x you would
>need to create a Route that matches the desired name.  Then you would
>create a CNAME entry for that in your DNS server that points your
>desired hostname to your router.  Hopefully I'm underestanding you
>correctly and this is what you'd like to do.
>
>--Brenton
>
>>
>> --
>> Srinivas Kotaru
>>
>> From: Dale Bewley <dale bewley net>
>> Date: Tuesday, January 19, 2016 at 7:21 PM
>> To: skotaru <skotaru cisco com>
>> Cc: dev <dev lists openshift redhat com>, "users lists openshift redhat com"
>> <users lists openshift redhat com>
>> Subject: Re: routing/vhost alias
>>
>> Try `oc expose service app --hostname=alias-FQDN`, and assuming you point
>> alias-FQDN at your default openshift-FQDN, the route should work.
>>
>>
>> ----- On Jan 19, 2016, at 5:47 PM, Srinivas Naga Kotaru (skotaru)
>> <skotaru cisco com> wrote:
>>
>> Hi
>>
>> In OSE 2.X we have a alias concept for routes. User or admin can create an
>> alias ( apache vhost definition) for an application and create a DNS recored
>> to point to upstream load balancer. This was so flexible if user FQDN is
>> different than openshift created http url (  example
>> http://<app>-<domain>.domain).
>>
>> In 3.X we have router instead of apache node proxy. Can user or admin create
>> similar alias entries?
>>
>> The reason am asking, client facing virtual are different than openshift
>> generated URL’s for each app in our environment.  We need a mechanism to
>> map/proxy client facing url to openshift generated URL. Thus, it requires or
>> have same Host header at backend using VHOST serveralias or HAProxy using
>> some ACL definition etc.
>>
>>
>> --
>> Srinivas Kotaru
>>
>> _______________________________________________
>> users mailing list
>> users lists openshift redhat com
>> http://lists.openshift.redhat.com/openshiftmm/listinfo/users
>>
>>
>> _______________________________________________
>> dev mailing list
>> dev lists openshift redhat com
>> http://lists.openshift.redhat.com/openshiftmm/listinfo/dev
>>

_______________________________________________
dev mailing list
dev lists openshift redhat com
http://lists.openshift.redhat.com/openshiftmm/listinfo/dev


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]