hostname-override should be hostname rather than ip

Bug #1620455 reported by PanFengyun
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magnum
Fix Released
Undecided
yatin

Bug Description

The '--hostname-override' of KUBELET_ARGS should be the hostname of node rather than the ip of node.

--hostname-override=$KUBE_NODE_IP
--->
--hostname-override=$KUBE_NODE_NAME

Revision history for this message
PanFengyun (pan-feng-yun) wrote :

I will fix it at next version(O).

Changed in magnum:
assignee: nobody → PanFengyun (pan-feng-yun)
Revision history for this message
hongbin (hongbin034) wrote :

@PanFengyun,

Could you elaborate it? Why it should be hostname instead of ip address?

Changed in magnum:
status: New → Incomplete
Revision history for this message
PanFengyun (pan-feng-yun) wrote :

@hongbin,
Sorry for answering you question too late.
We know that:
1.# kubelet -h
--hostname-override="": If non-empty, will use this string as identification instead of the actual hostname.
2.kubernetes/pkg/cloudprovider/providers/openstack/openstack.go
------
50 var ErrNotFound = errors.New("Failed to find object")

240 func getServerByName(client *gophercloud.ServiceClient, name string) (*servers.Server, error) {
241 opts := servers.ListOpts{
242 Name: fmt.Sprintf("^%s$", regexp.QuoteMeta(name)),
243 Status: "ACTIVE",
244 }
245 pager := servers.List(client, opts)
-----
Kubernetes filters the vm of nova by 'Name' and 'Status' of server. If hostname-override is the ip of server, kubernetes can not get server from openstack.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to magnum (stable/newton)

Fix proposed to branch: stable/newton
Review: https://review.openstack.org/373417

Changed in magnum:
assignee: PanFengyun (pan-feng-yun) → yatin (yatinkarel)
status: Incomplete → In Progress
Changed in magnum:
assignee: yatin (yatinkarel) → PanFengyun (pan-feng-yun)
Revision history for this message
PanFengyun (pan-feng-yun) wrote :

@yatin
I have made a patch to fix this bug, and I am testing it now, you should not fix my bug.

Revision history for this message
yatin (yatinkarel) wrote :

@PanFengyun,

I cannot find any patch on this yet. Can you provide the link.

Also, i checked your comment(I will fix it at next version(O).) that you are going to Fix this in next version(). But we cannot wait for functional bug till next version.

To your comment on https://review.openstack.org/#/c/373417/:
<<< when hostname-override is the ip of node, the nodes can use the ip to connect node. But when hostname-override is the hostname of node, the nodes can not do it.
I think you should add the ip and hostname of all nodes into /etc/hosts for every nodes, then the node can resolve hostnames and connect others

>>> Can you tell the reason why entry is required in /etc/hosts/?
I think kubelet works with it's configuration, and in configuration we use the IP(API, master, etc) only and the application will work without doing entry in /etc/hosts/.

--->hostname-override is required by cinder volume driver to identify node with hostname and use it to attach volume.
Yes, if any user has specific requirement to resolve hostname then entry has to be done manually.
Yes, if you have some reason that stats that k8s will not work without doing entry in /etc/hosts, then please reply as a comment.
The same is proposed in patch: https://review.openstack.org/#/c/373417/ and https://review.openstack.org/#/c/373097/

Changed in magnum:
assignee: PanFengyun (pan-feng-yun) → yatin (yatinkarel)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (master)

Reviewed: https://review.openstack.org/373097
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=6a16c862157cde29533aa177348226ee09e63332
Submitter: Jenkins
Branch: master

commit 6a16c862157cde29533aa177348226ee09e63332
Author: yatin <email address hidden>
Date: Tue Sep 20 15:01:27 2016 +0530

    Fix k8s_fedora to work with cinder volume driver

    cinder volume driver of kubernetes requires hostname to be
    same as instance name so that volume can be attached to
    node running the pod, hostname-override is not required
    by cinder volume driver.

    hostname-override was introduced with following patch:
    I55df72c8f36d81852bde36018c17670101860f79

    In this patch following are fixed:
    1) v3 --> v2(incorrect keystone version) is changed to v3 --> v2.0
    2) --hostname-override is not added to KUBELET_ARGS for cinder
    volume driver.

    Change-Id: I1347b934d99ad6fe04e124e295c4961fe77c6b20
    Closes-Bug: #1625479
    Closes-Bug: #1620455

Changed in magnum:
status: In Progress → Fix Released
tags: added: in-stable-newton
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to magnum (stable/newton)

Reviewed: https://review.openstack.org/373417
Committed: https://git.openstack.org/cgit/openstack/magnum/commit/?id=a7d719d08ac22bc9e023c1dae72bbf20210ff1e6
Submitter: Jenkins
Branch: stable/newton

commit a7d719d08ac22bc9e023c1dae72bbf20210ff1e6
Author: yatin <email address hidden>
Date: Tue Sep 20 15:01:27 2016 +0530

    Fix k8s_fedora to work with cinder volume driver

    cinder volume driver of kubernetes requires hostname to be
    same as instance name so that volume can be attached to
    node running the pod, hostname-override is not required
    by cinder volume driver.

    hostname-override was introduced with following patch:
    I55df72c8f36d81852bde36018c17670101860f79

    In this patch following are fixed:
    1) v3 --> v2(incorrect keystone version) is changed to v3 --> v2.0
    2) --hostname-override is not added to KUBELET_ARGS for cinder
    volume driver.

    Change-Id: I1347b934d99ad6fe04e124e295c4961fe77c6b20
    Closes-Bug: #1625479
    Closes-Bug: #1620455

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/magnum 3.1.1

This issue was fixed in the openstack/magnum 3.1.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/magnum 4.0.0

This issue was fixed in the openstack/magnum 4.0.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.