Bug 1284621

Summary: Setting the nodeIP is overriding the node hostname
Product: OpenShift Container Platform Reporter: Federico Simoncelli <fsimonce>
Component: NetworkingAssignee: Ravi Sankar <rpenta>
Status: CLOSED CURRENTRELEASE QA Contact: Meng Bo <bmeng>
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.1.0CC: aos-bugs, eparis, jliggitt, jokerman, mmccomas, pweil, tdawson
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-01-29 20:57:54 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 Federico Simoncelli 2015-11-23 16:51:42 UTC
Description of problem:
With reference to the issue:

https://github.com/openshift/openshift-ansible/issues/943

The OpenShift nodes are registering themselves using the nodeIP instead of the regular hostname:

    if len(options.NodeIP) > 0 {
            server.HostnameOverride = options.NodeIP
    } else {
            server.HostnameOverride = options.NodeName
    }

https://github.com/openshift/origin/blob/v1.0.8/pkg/cmd/server/kubernetes/node_config.go#L114

As a result the nodes set the kubernetes.io/hostname and externalID with the ip address instead of the hostname:

NAME                              LABELS                                STATUS    AGE
oshift01.eng.lab.tlv.redhat.com   kubernetes.io/hostname=10.35.19.229   Ready     8h
oshift02.eng.lab.tlv.redhat.com   kubernetes.io/hostname=10.35.19.230   Ready     8h


How reproducible:
100%

Steps to Reproduce:
1. Deploy a cluster setting the nodeIP in the nodes config

Actual results:
The nodes labels kubernetes.io/hostname and externalID are configured with the ip address.

Expected results:
The nodes labels kubernetes.io/hostname and externalID are configured with the hostname.

Comment 2 Paul Weil 2015-12-01 18:10:14 UTC
*** Bug 1284614 has been marked as a duplicate of this bug. ***

Comment 3 Ravi Sankar 2016-01-11 20:19:21 UTC
Fixed in https://github.com/openshift/origin/pull/6310 
This PR will be merged once we rebase kube and resolve issue https://github.com/kubernetes/kubernetes/issues/17731

Comment 4 Eric Paris 2016-01-14 13:50:53 UTC
Fix was merged to origin last night. Will go ON_QA after the next OSE build.

Comment 5 Meng Bo 2016-01-15 07:17:26 UTC
Verified on build 2016-01-14.1

Issue has been fixed.

After add the "nodeIP: 10.66.128.92" to node-config.yaml and start the node service. The node label and externalID will still using the hostname.

# oc get node ose-node2.bmeng.local --template {{.spec.externalID}},{{.metadata.labels}}
ose-node2.bmeng.local,map[kubernetes.io/hostname:ose-node2.bmeng.local]