Bug 1161072

Summary: The app dns will not be registered to the 2nd haproxy gear's node
Product: OpenShift Online Reporter: Meng Bo <bmeng>
Component: ContainersAssignee: Andy Goldstein <agoldste>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: agoldste, bmeng, bperkins, jokerman, mmccomas
Target Milestone: ---   
Target Release: 2.x   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1163406 (view as bug list) Environment:
Last Closed: 2015-02-18 16:52:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1163406    

Description Meng Bo 2014-11-06 10:43:17 UTC
Description of problem:
Create HA app on a multinode env. Add the node ip of the 2nd haproxy gear to /etc/hosts with the app dns.

When trying to visit the app dns, it will return 404 page. The app dns was not registered to the node frontend.

Version-Release number of selected component (if applicable):
devenv_5281

How reproducible:
always

Steps to Reproduce:
1. Setup multinode env
2. Create Scalable app on it and make it HA
3. Add the node ip of the 2nd haproxy gear and app dns to /etc/hosts
4. Visit the app dns.

Actual results:
It will return 404 page.

Expected results:
Should show the app home page when visiting the app dns which point to the 2nd haproxy gear's node.

Additional info:
Visit the app alias will not hit this problem.

# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6


54.81.35.75 php541s-bmengdevnew.dev.rhcloud.com foo.bmeng.com

# curl -Ik https://php541s-bmengdevnew.dev.rhcloud.com/
HTTP/1.1 404 Not Found
Date: Thu, 06 Nov 2014 15:39:55 GMT
Server: Apache/2.2.15 (Red Hat)
Vary: Accept-Encoding
Content-Type: text/html; charset=iso-8859-1

# curl -Ik https://foo.bmeng.com/
HTTP/1.1 200 OK
Date: Thu, 06 Nov 2014 15:40:21 GMT
Server: Apache/2.2.15 (Red Hat)
Content-Type: text/html; charset=UTF-8
Cache-control: private
Set-Cookie: GEAR=local-545b8bc7e4364b0094000004; path=/
Vary: Accept-Encoding
Accept-Ranges: none
ProxyTime: D=1307

Comment 1 Andy Goldstein 2014-11-10 18:55:45 UTC
I don't believe this is a bug. You would need a load balancer handling requests for the HA app URL (e.g. ha-myapp.yourdomain.rhcloud.com), and the load balancer would forward the requests to the app's haproxy gears.

Comment 2 Andy Goldstein 2014-11-10 22:05:44 UTC
Ignore my previous comment. I wasn't aware we had implemented this. This is probably something that broke with the switch from mod-rewrite to vhost. I'll keep investigating.

Comment 3 Andy Goldstein 2014-11-12 16:13:43 UTC
https://github.com/openshift/origin-server/pull/5954

Comment 4 openshift-github-bot 2014-11-12 20:14:12 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/f778d2b60f5708c9a4a44420b6d4ae1d4793d6a5
Register app dns vhost for secondary haproxy gears

Modify the vhost frontend plugin to create a 2nd base vhost conf file
for the app dns so secondary haproxy gears can handle requests for
$OPENSHIFT_APP_DNS

Bug 1161072

Comment 5 Meng Bo 2014-11-13 10:30:26 UTC
Checked on devenv-stage_1106, both the app dns and the aliases can be visited with the host ip of all the nodes.

move bug to verified.