Bug 1051015 - node.conf config value names have changed
Summary: node.conf config value names have changed
Keywords:
Status: CLOSED EOL
Alias: None
Product: OKD
Classification: Red Hat
Component: Containers
Version: 2.x
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: ---
Assignee: Luke Meyer
QA Contact: libra bugs
URL:
Whiteboard:
Depends On:
Blocks: 1051251 1136983
TreeView+ depends on / blocked
 
Reported: 2014-01-09 14:48 UTC by Luke Meyer
Modified: 2017-01-25 06:38 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1051251 1136983 (view as bug list)
Environment:
Last Closed: 2017-01-25 06:38:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Luke Meyer 2014-01-09 14:48:14 UTC
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.

Proposed steps to remedy:
1. Update all code using any of these names to look for both the new and old value names (frontend_proxy.rb, oo-accept-node, application_container_ext/setup.rb, libvirt_container.rb, probably others need updates).
2. Update node.conf with new values (optional, really)

Comment 1 Lokesh Mandvekar 2014-01-17 20:05:45 UTC
https://github.com/openshift/origin-server/pull/4488 should fix this

Comment 2 Meng Bo 2014-01-20 06:46:48 UTC
Checked on devenv_4242,

the file application_container_ext/setup.rb only look for the new name in the code.

# grep "config.get" /opt/rh/ruby193/root/usr/share/gems/gems/openshift-origin-node-1.19.11/lib/openshift-origin-node/model/application_container_ext/setup.rb
                      "#{@application_name}-#{@namespace}.#{@config.get("CLOUD_DOMAIN")}",
                      "#{@container_name}-#{@namespace}.#{@config.get("CLOUD_DOMAIN")}",
          min_uid = (@config.get("GEAR_MIN_UID") || "500").to_i
          max_uid = (@config.get("GEAR_MAX_UID") || "1500").to_i



And for the other fixed @uid_begin value, it is better to set the number to default value 1000 instead of 500 if no config defined.

        @uid_begin = (config.get("UID_BEGIN") || config.get("GEAR_MIN_UID") || "500").to_i

Comment 3 openshift-github-bot 2014-01-20 18:04:00 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/90f2dfd0bd4792696cdfd6c9b60f506ac2ee3f42
Bug 1051015 - Look for UID_BEGIN, default to 1000

Signed-off-by: Lokesh Mandvekar <lsm5>

Comment 4 Meng Bo 2014-01-22 08:12:07 UTC
Checked on devenv_4257, all the config files are fixed.

Move bug to verified.

Comment 5 Dan Mace 2014-01-28 16:48:44 UTC
Re-opening this bug. Reading the key name at this point (when our own and other installations are mis-configured such that the code default is what's actually being used) is likely to cause all sorts of issues[1] unless the operator also verifies their node.conf contains the new key using whatever their previous effective value is.

We need to pull this patch until we can agree on the safest way to go about it, and also accompany the change with loudly communicated details on how to verify node.conf is correctly configured following the rollout.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1056961

Comment 7 Luke Meyer 2014-09-03 18:28:51 UTC
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.

Comment 8 Luke Meyer 2014-09-03 18:40:21 UTC
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 9 openshift-github-bot 2014-09-03 19:37:02 UTC
Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/a80d21486a579015e5daea83ad32f8da6c3133cb
oo-accept-node: remove check for unused settings

https://bugzilla.redhat.com/show_bug.cgi?id=1051015
Bug 1051015 - node.conf config value names have changed

Comment 10 Meng Bo 2014-09-04 05:32:35 UTC
The changes in https://github.com/openshift/origin-server/pull/5780 was not pushed to latest devenv_5139, needs to update the li repo for Online?

Comment 11 Luke Meyer 2014-09-04 13:20:28 UTC
An online devenv overwrites the default node.conf and I'm not sure I really want to interfere with that (or that it would pertain to this). This is an Origin bug; I'm not sure how you would normally test that other than running an Origin install.


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