Open janeczku opened 5 years ago
I can reproduce this issue. The key point is that the hostname setting is implemented by docker-machine through ssh, so the network is initialized before setting hostname. We can get the hostname
config from /var/lib/rancher/conf/cloud-config.d/machine-hostname.ym
.
When netconf initiated the dhcp request, ros has not yet obtained the hostname from docker-machine, so the dhcpcd always use rancher
hostname.
There are several options for solving this problem:
rancher/machine
, restart the network after it sets the hostnameros netconf
detect the hostname change and re-initiate the dhcp request with the new hostnameReference:
I'm passing this into guestinfo.cloud-init.config.data
as a workaround
#cloud-config
runcmd:
- sudo nohup `sleep 60; system-docker restart network` &>/dev/null &
This is still an issue with the current version of rancheros - 1.5.8
cc @olljanat - any chance this is resolved in BurmillaOS?
@PrplHaz4 is this same as https://github.com/burmilla/os/issues/52 ? I expected that it was new bug on BurmillaOS. Good to know if that is older thing...
@PrplHaz4 is this same as burmilla#52 ? I expected that it was new bug on BurmillaOS. Good to know if that is older thing...
Looks and sounds the same to me, but I probably won't have any time to test/confirm in the near future.
RancherOS Version: (ros os version) v1.5.1
Where are you running RancherOS? (docker-machine, AWS, GCE, baremetal, etc.) vSphere v1.5.0.
Actual behaviour:
per https://github.com/rancher/os/issues/627#issuecomment-460618187):
I am deploying RancherOS from Rancher vSphere provider, which sets the hostname according to node name defined in Rancher UI.
In general, the hostname gets applied correctly (I can see it on the console and it gets reported correctly by VMware Tools).
However, in the DHCP request it contains the default hostname rancher so it gets registered with this name in DNS (what is not intended).
Like mentioned in the initial issue I can use sudo system-docker restart network promote the correct hostname to DHCP after RancherOS is initialized.
But of course I don't want to run this command manually in the automated process of provisioning RancherOS with Rancher vSphere provider.
TLDR: Rancher node IP addresses get registered with the incorrect default hostname
rancher
resulting in incorrect DNS entries, e.g.rancher.<enterprise-domain>
.Expected behaviour:
When hostname is changed from the default
rancher
to the one specified in cloud-config or via docker machine, then a DHCP renew request should be send in order to register the correct hostname.