Bug 1136983 - node.conf config value names have changed
Summary: node.conf config value names have changed
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Containers
Version: 2.1.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Luke Meyer
QA Contact: libra bugs
URL:
Whiteboard:
Depends On: 1051015
Blocks: 1051251
TreeView+ depends on / blocked
 
Reported: 2014-09-03 18:45 UTC by Luke Meyer
Modified: 2014-09-18 15:20 UTC (History)
10 users (show)

Fixed In Version: openshift-origin-node-util-1.22.20.2-1.el6op rubygem-openshift-origin-node-1.23.9.21-1.el6op
Doc Type: Bug Fix
Doc Text:
The default /etc/openshift/node.conf file on node hosts contained gear UID and port settings that are no longer used as described and did not contain the actual settings for those purposes. This made it confusing when trying to change the port range, starting gear UID, or ports per gear. This bug fix updates this default file for new installations to remove the unused options. It also adds notes for options that should not be changed that must remain for historical purposes, and introduces accurate settings (PORTS_PER_USER and PORT_BEGIN) with helpful comments regarding restrictions on changing them. This file on existing installations is unaffected.
Clone Of: 1051015
Environment:
Last Closed: 2014-09-11 20:06:58 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2014:1183 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise 2.1.6 bug fix and enhancement update 2014-09-12 00:06:21 UTC

Description Luke Meyer 2014-09-03 18:45:05 UTC
+++ This bug was initially created as a clone of Bug #1051015 +++

The default /etc/openshift/node.conf is installed with the following values defined:
GEAR_MIN_UID=1000        # Lower bound of UID used to create gears
GEAR_MAX_UID=6999        # Upper bound of UID used to create gears
PROXY_MIN_PORT_NUM=35531 # Lower bound of port numbers used to proxy ports externally
PROXY_PORTS_PER_GEAR=5   # Number of proxy ports available per gear

Code looking for these values now looks for new names and ignores these.
https://github.com/openshift/origin-server/blob/master/node/lib/openshift-origin-node/model/frontend_proxy.rb#L50
        @port_begin = (config.get("PORT_BEGIN") || "35531").to_i
        @ports_per_user = (config.get("PORTS_PER_USER") || "5").to_i
        @uid_begin = (config.get("UID_BEGIN") || "500").to_i
(I couldn't find any analog to GEAR_MAX_UID but should be consistent ).

I think this happened around the v2 cartridge refactor, and actually there is some code looking at both forms (grep for GEAR_MIN_ID as well as UID_BEGIN). Most people never want to change the defaults, but they should be able to using what's in the config file.

--- Additional comment from Luke Meyer on 2014-09-03 14:28:51 EDT ---

I think this is "solved" by https://github.com/openshift/origin-server/pull/5780 which is intended to only change the default node.conf so users have some hope of understanding what they should do here. No code changes necessary.

Here is my summary:

Assuming districts, GEAR_MIN_UID and GEAR_MAX_UID no longer play any role except in an obscure calculation in application_container_ext/setup.rb where, as far as I can determine, the important thing is that they not change (no need to match the actual UIDs being used). As such, I've left them in the node.conf with their existing values (not the code defaults) and designated them as vestigial/do not change.

PROXY_MIN_PORT_NUM and PROXY_PORTS_PER_GEAR no longer have any role at all so they've been removed from the node.conf. PORT_BEGIN and PORTS_PER_USER (which take over the functions these formerly held) have been added to node.conf with their code defaults and a fair amount of comments that I hope will help users.

--- Additional comment from Luke Meyer on 2014-09-03 14:40:21 EDT ---

I realized that oo-accept-node will now complain about the missing PROXY_ settings, so https://github.com/openshift/origin-server/pull/5781 addresses that.

Comment 1 Luke Meyer 2014-09-03 18:50:31 UTC
What about UID_BEGIN? Its only use is in another obscure calculation, this time in node/lib/openshift-origin-node/model/frontend_proxy.rb where as with GEAR_MIN_UID the important thing is that it not change. This has never been set in node.conf so it never should be.

Comment 4 Luke Meyer 2014-09-03 19:17:16 UTC
origin-server cherrypicks:

commit 18a380023392daadd0a5c8da96fb8f6ea1b5b08f
Author: Luke Meyer lmeyer
Date: Sun Aug 31 20:07:29 2014 -0400

  node.conf: comments for external port range


commit a80d21486a579015e5daea83ad32f8da6c3133cb
Author: Luke Meyer lmeyer
Date: Wed Sep 3 14:35:56 2014 -0400

  oo-accept-node: remove check for unused settings

Comment 7 Anping Li 2014-09-05 05:53:23 UTC
Verify and pass on OSE 2.1.z/2014-09-04.1
1. After update, the node.conf was updated. ->pass
2. oo-accept-node using the uid from broker. -> pass
   1) Modify first uid in openshift-origin-msg-broker-mcollective.conf
   2) Modify the max uid in broker 
      oo-admin-ctl-district -c remove-capacity -n sgears --size 100
      oo-admin-ctl-district -c publish-uids
   3) oo-accept-node -v
3. PORT_BEGIN, PORTS_PER_USER take affect. ->pass

Comment 8 Anping Li 2014-09-05 08:27:07 UTC
(Test scenarios for step 3 in comment #7)

For step 3, The following scenarios are used to verify PORT_BEGIN, PORTS_PER_USER. 
1) set PORT_BEGIN=65531, the oo-iptables-port-proxy will use proxy  between 65531 to 65536.
September 05 01:52:29 INFO Shell command 'oo-iptables-port-proxy addproxy 65531 "127.10.154.1:8080"' ran. rc=0 out=-I rhc-app-comm 1 -d 127.10.154.1 -p tcp --dport 8080 -j ACCEPT -m comment --comment 65531
September 05 01:52:34 INFO Shell command 'oo-iptables-port-proxy addproxy 65532 "127.10.154.2:8080"' ran. rc=0 out=-I rhc-app-comm 1 -d 127.10.154.2 -p tcp --dport 8080 -j ACCEPT -m comment --comment 65532
S

2)  set PORTS_PER_USER=2, the app creation with jbosseap should fail due to no port available.

Result:
root@node1 node]# cat platform.log|grep "No ports were left available to map"
September 05 04:10:59 INFO openshift-agent: request end: action=cartridge_do, requestid=57ad56d6d9b551ff8b9e9f56186f71c4, senderid=broker.ose.com.cn, statuscode=1, data={:time=>nil, :output=>"No ports were left available to map 127.8.146.129:5445: uid=4389", :exitcode=>1, :addtl_params=>nil}

Comment 10 errata-xmlrpc 2014-09-11 20:06:58 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.

http://rhn.redhat.com/errata/RHBA-2014-1183.html


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