Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1191357

Summary: master node is always shown in the output of `osc get mi`
Product: OpenShift Container Platform Reporter: Johnny Liu <jialiu>
Component: ocAssignee: Fabiano Franz <ffranz>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.0.0CC: bleanhar, dmcphers, jokerman, libra-onpremise-devel, lmeyer, mmccomas, nicholas_schuetz
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openshift-0.4-0.git.45.42737cc.el7ose.x86_64 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-08 17:35:20 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:

Description Johnny Liu 2015-02-11 07:07:24 UTC
Description of problem:
If one node only take role of master, it should not be in minion list. But now master node is always shown in the output of `osc get mi`.

Version-Release number of selected component (if applicable):
# openshift version
openshift v0.3-13-gcf46f712f7894f
kubernetes v0.10.0-46-g72ad4f1

How reproducible:
Always

Steps to Reproduce:
1. Follow https://github.com/openshift/training/blob/master/beta-1-setup.md to set up master node (Note: this node only take role of master, do not install any node packages and service).
# rpm -qa|grep openshift
openshift-0.3.0-0.git.145.cf46f71.el7ose.x86_64
openshift-sdn-0.4-1.git.0.4809789.el7ose.x86_64
openshift-master-0.3.0-0.git.145.cf46f71.el7ose.x86_64
openshift-sdn-master-0.4-1.git.0.4809789.el7ose.x86_64
2. Start openshift-master service.
# osc get mi
NAME                LABELS              STATUS
jialiu-master       <none>              NotReady
3. Manually delete this minion.
# osc delete mi jialiu-master
jialiu-master
# osc get mi
NAME                LABELS              STATUS
4. Restart openshift-master service
# osc get mi
NAME                LABELS              STATUS
jialiu-master       <none>              NotReady


Actual results:
Step 2, the node only take master role, but it still is listed in minion list.
Step 4, after restart master service, the master minion came back and list there again.


Expected results:
If one node only take role of master, it should not be in minion list. After manually delete minion, it should be not came back.

Additional info:

Comment 1 Johnny Liu 2015-02-11 07:18:24 UTC
If the master is listed there, the following error is always seen in log:
Feb 11 15:17:01 jialiu-master openshift: I0211 15:17:01.408198    4529 http.go:54] HTTP probe error: Get http://jialiu-master:10250/healthz: dial tcp 10.66.79.140:10250: connection refused

Comment 2 Scott Dodson 2015-02-11 20:21:05 UTC
This happens because if you don't provide a node list it defaults to using 127.0.0.1 and adding cfg.Hostname to the NodeList. I'm trying to determine if there's a technical reason that we must have at least one node.

Comment 3 Brenton Leanhardt 2015-02-11 20:30:20 UTC
I'm pretty sure it's an artifact of the "30 seconds admin experience" where we want as much as possible to be there out of the box for all-in-one environments.

We should definitely figure out a reasonable way for this not to be the behavior when the master is started by systemd in OSE.  I think we want to at least make sure 'openshift start' continues to start everything however if 'openshift start master' is explicitly started I think it would be OK to have an empty NodeList.

Comment 4 Scott Dodson 2015-02-11 20:34:44 UTC
Workaround: specify at least one node by adding --nodes=hostname to OPTIONS in /etc/sysconfig/openshift-master

I'm a bit hesitant to submitting a PR to remove the default inclusion of localhost from the list of nodes as it makes it very simple to install both master and node on one host and have a working config. Without it you'll have to add localhost either via --nodes or via the API.

Comment 5 Luke Meyer 2015-02-13 14:53:17 UTC
I agree that having it add itself by default is very useful for user exp and doesn't really harm anything other than having an extra (inactive) entry in the node list. 

Perhaps we could have "--node=" (empty option, or "--no-node") on openshift-master OPTIONS as a hint not to add self and just wait for nodes to be added by API.

Comment 6 Brenton Leanhardt 2015-02-16 14:09:43 UTC
I'd be fine with adding a new flag for the OSE production use case.  This new flag would be the default for the openshift-master when started by the RPMs so it shouldn't impose any burden on all-in-one environments building from source or using docker images.

I'd vote for calling it something like "--no-auto-node".  "--no-node" might make people think that they want to run it without extra nodes and therefore would expect an all-in-one style environment.

Comment 7 Luke Meyer 2015-02-16 16:39:05 UTC
I'm not really seeing another flag just for this. You can actually already do it with --node= just by supplying a bogus node name, e.g. in sysconfig:

OPTIONS="--loglevel=1 --nodes=*"

The downside now is that you get errors in the master log about this being unresolvable etc. so it's definitely just a workaround. Would it be too cryptic to just make "--nodes=" disable all auto-node-adding and make that the default in openshift-master?

Comment 8 Brenton Leanhardt 2015-02-16 16:53:13 UTC
I definitely prefer that there be a way for the master to know it's in OSE mode and avoid as much all-in-one stuff as possible and the need for extra flags.  I didn't see something that wasn't a hack that would complicate the all-in-one setup.  The first workaround I tried was to set "--nodes=".  I didn't really like that error message and it would be really confusing to me as an admin to see it in a config file.

Eventually I think we'll get to the point where we'll have enough 'all-in-one' assumptions that we'll need some concept of '--env=production' and have it read some other defaults or something.

Comment 9 Jason DeTiberus 2015-02-16 16:55:25 UTC
I'm on the fence over whether a new flag would be warranted...  

Having '--nodes=' be interpreted differently than not specifying --nodes seems a bit counter-intuitive to me. I would be okay with a special char/word being the trigger if we choose to not add a new flag.

If we are going to add a new flag, then --no-local-node would make more sense to me than --no-auto-node (which would seem like it would disable some wanted behavior) and --no-node (which makes it seem like a node-less install).

Comment 10 Brenton Leanhardt 2015-02-16 17:00:21 UTC
I could live with --no-local-node.

Comment 11 Miciah Dashiel Butler Masters 2015-02-16 17:03:43 UTC
Because bikeshedding is fun...

How about `openshift start standalone-master`?

Although I didn't see a response to comment #3 why we couldn't have `openshift start` start the all-in-one and `openshift start master` start a standalone master...

Comment 12 Brenton Leanhardt 2015-02-16 17:09:00 UTC
I think I was worried about existing workflows breaking but that would definitely be my preference.

Comment 13 Luke Meyer 2015-02-16 17:36:05 UTC
If you don't have the master add itself by default, then the OSE all-in-one experience changes from:

1. systemctl start openshift-master openshift-node

to:

1. systemctl start openshift-master openshift-node
2. osc create -f <file with ugly json>  # just to get the local node

At least (2) is *possible* now that adding a node via API actually works again. And it would have the advantage that nodes will tend to be defined uniformly (while the current master default fills in resource details that we didn't include in templates for non-master nodes, which appears to skew the scheduling). And it will probably be replaced with "openshift add-node" or similar later making it more sane.

Comment 14 Brenton Leanhardt 2015-02-16 18:52:31 UTC
I guess there are technically two all-in-one scenarios.  The one I'm most concerned with not breaking is 'openshift start'.  Having that launch everything is how we are able to quickly run everything inside a docker container.

I think we'd be able to make a case for 'openshift start master' and 'openshift start node'  only doing that and move the local node creation to only the 'openshift start' case.

Comment 15 Scott Dodson 2015-03-10 21:11:47 UTC
A node is no longer created when running 'openshift start master'

Comment 16 Johnny Liu 2015-03-11 01:41:38 UTC
Verified this bug against the following packages, now master node is not listed there on master node.
openshift-sdn-0.4-3.git.0.954ef11.el7ose.x86_64
openshift-master-0.4-0.git.43.e57c9a8.el7ose.x86_64
openshift-sdn-master-0.4-3.git.0.954ef11.el7ose.x86_64
openshift-0.4-0.git.43.e57c9a8.el7ose.x86_64

Comment 17 Josep 'Pep' Turro Mauri 2015-09-08 17:35:20 UTC
Closing this as part of a bulk update/cleanup of multiple bugs that were VERIFIED before OSE 3.0 GA but were left open and haven't been updated since.

If this bug was meant to stay open for some reason please reopen.