Bug 1159182 - some useless conf files are created by openshift-routing-daemon
Summary: some useless conf files are created by openshift-routing-daemon
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 2.2.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: ---
Assignee: chris alfonso
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-10-31 07:11 UTC by Johnny Liu
Modified: 2016-02-01 02:36 UTC (History)
7 users (show)

Fixed In Version: rubygem-openshift-origin-routing-daemon-0.20.2.4-1.el6op
Doc Type: Bug Fix
Doc Text:
In OpenShift Enterprise environments using the routing daemon with an nginx router, nginx configuration files were created for non-scalable applications, however they are not necessary as the routing daemon only routes for scalable applications. In addition, a hard-coded prefix of "ha-" was added to configuration files for scalable applications when they did not have an alias configured, which could cause confusion. This bug fix updates the routing daemon to no longer create nginx configuration files for non-scalable applications. In addition, the /etc/openshift/routing-daemon.conf file now includes the HA_DNS_PREFIX parameter, which allows administrators to define a prefix for scalable applications, if desired. This prefix must match the prefix that is set in the HA_DNS_PREFIX parameter in the /etc/openshift/broker.conf file, as well.
Clone Of:
Environment:
Last Closed: 2014-12-10 13:24:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1979 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.2.2 bug fix and enhancement update 2014-12-10 18:23:46 UTC

Description Johnny Liu 2014-10-31 07:11:23 UTC
Description of problem:
Set up env, and start openshift-routing-daemon service.
Scenarios 1:
* Create a non-scalable app. 
Go to /opt/rh/nginx14/root/etc/nginx/conf.d, the following file is generated.
# ls
alias_pool_ose_php53app_jialiu_80_ha-php53app-jialiu.example.com.conf  pool_ose_php53app_jialiu_80.conf  server.conf
# cat server.conf 

server {
  listen 80;
  
  # route_name=route_ose_php53app_jialiu
  location /php53app {
    proxy_pass http://pool_ose_php53app_jialiu_80;
    
  }

}
# cat pool_ose_php53app_jialiu_80.conf
The config file is passing request to pool_ose_php53app_jialiu_80 downstream, while pool_ose_php53app_jialiu_80.conf is empty. If user is creating a non-scalable app, these config files does not take any effect, they are meaningless. openshift-routing-daemon should not create any config file when daemon detects the app is not a scaling app.


Scenarios 2:
* Create a scalable app. 
Go to /opt/rh/nginx14/root/etc/nginx/conf.d, the following file is generated.
# ls
alias_pool_ose_scaphp53app_jialiu_80_ha-scaphp53app-jialiu.example.com.conf  pool_ose_scaphp53app_jialiu_80.conf  server.conf
# cat alias_pool_ose_scaphp53app_jialiu_80_ha-scaphp53app-jialiu.example.com.conf

server {
  listen 80;
  server_name ha-scaphp53app-jialiu.example.com;
  location / {
    proxy_pass http://pool_ose_scaphp53app_jialiu_80;
    
  }
}
"alias_pool_ose_scaphp53app_jialiu_80_ha-scaphp53app-jialiu.example.com.conf" is always created even this app does not have any alias.  After search code, it is using hard code to add "ha-" prefix for server name, but maybe user would never add such alias. This would confuse user (at least, it confuse me).
And when I add a real alias for this app, a specified config for the real alias is created, so suggest do NOT create such alias config when app does not have any alias yet.


Version-Release number of selected component (if applicable):
rubygem-openshift-origin-routing-daemon-0.17.1.4-1.el6op.noarch

How reproducible:
Always

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 chris alfonso 2014-10-31 13:10:46 UTC
Thanks for testing this Johnny. The naming of the conf files are a bit weird, but the way it works is we create a pool file when the application is created even if there are no members in the pool yet. The alias file does not only represent an alias created with RHC, it's also the alias created for any ha app. These config files will be removed when the application is removed. Also, thanks for catching the hard-coded ha- prefix!

Comment 2 chris alfonso 2014-11-25 20:05:50 UTC
This is now fixed as part of https://github.com/openshift/enterprise-server/commit/f7043cae2dcac8631c8ee5319c82a433c9ac294b

Comment 5 Johnny Liu 2014-11-26 05:57:42 UTC
Retest this bug with rubygem-openshift-origin-routing-daemon-0.20.2.3-1.el6op.noarch.

The issue found in scenarios 1 is fixed now, when creating non-scalable app, no nginx config files are generated.


The hard-coded ha- prefix issue found in scenarios 2 is not fixed yet, the prefix should be allow user to set it in /etc/openshift/routing-daemon.conf

Comment 6 chris alfonso 2014-11-26 06:35:22 UTC
There is no reason to have any nginx config files for non-scalable apps. I missed the ha-prefix hard coding that was mentioned. I'll fix that.

Comment 9 chris alfonso 2014-11-26 16:12:18 UTC
PR open upstream. Will merge to enterprise-server when it's ready

Comment 12 Johnny Liu 2014-11-27 06:19:18 UTC
Verified this bug with rubygem-openshift-origin-routing-daemon-0.20.2.4-1.el6op.noarch, and PASS.


The lines mentioned in comment 7 is removed now.
The following config options are added in /etc/openshift/routing-daemon.conf:
HA_DNS_PREFIX="ha-"
After I change it to 
HA_DNS_PREFIX="hhh-"


Then create a scalable app, the following config file is generated.


# cat alias_pool_ose_scaruby18app_jialiu_80_hhh-scaruby18app-jialiu.example.com.conf

server {
  listen 80;
  server_name hhh-scaruby18app-jialiu.example.com;
  location / {
    proxy_pass http://pool_ose_scaruby18app_jialiu_80;
    
  }
}

server {
  listen 443 ssl;
  #ssl_certificate_template
  #ssl_certificate_key_template
  server_name hhh-scaruby18app-jialiu.example.com;
  location / {
    proxy_pass http://pool_ose_scaruby18app_jialiu_80;
    
  }
}

The modified config option takes effect now.

Comment 14 errata-xmlrpc 2014-12-10 13:24:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2014-1979.html


Note You need to log in before you can comment on or make changes to this bug.