rancher / k3os

Purpose-built OS for Kubernetes, fully managed by Kubernetes.
https://k3os.io
Apache License 2.0
3.5k stars 402 forks source link

DHCP provided properties ignored - e.g. hostname #641

Open sergeiwaigant opened 3 years ago

sergeiwaigant commented 3 years ago

Version (k3OS / kernel) k3os version v0.11.1 & latest v0.19.4-dev.5

Architecture x86_64

Describe the bug I am using pfSense as DHCP server and static mappings to assign IPs and other config like hostname to my systems. For other systems, like Fedora or CentOS, which I bootstrap with PXE (syslinux) the OS is able to get everything from the DHCP provided data. On the K3S machine its able to get the IP as expected, but the hostname and domain search list is ignored. Furthermore it is setting the domain name as domain search list.

Funny enough... when just booting the ISO and run the install manually I can see, that the hostname is set correctly, but domain search list is still ignored. Once installed, it is ignoring everything except the IP.

To Reproduce

My config.yml:

ssh_authorized_keys:
- github:sergeiwaigant
boot_cmd: []
init_cmd: []
run_cmd: []

k3os:
  data_sources:
  - aws
  environment: {}

  ntp_servers:
  - 0.de.pool.ntp.org
  - 1.de.pool.ntp.org
  - 2.de.pool.ntp.org
  - 3.de.pool.ntp.org

My PXE Boot

label k3os-0.19.4
  menu label ^Start & Install K3OS 0.19.4
  kernel http://truenas/pxeboot/k3os/v0.19.4/k3os-vmlinuz-amd64
  initrd http://truenas/pxeboot/k3os/v0.19.4/k3os-initrd-amd64,http://truenas/pxeboot/k3os/v0.19.4/k3os-rootfs-amd64.tar.gz,http://truenas/pxeboot/k3os/v0.19.4/k3os-kernel-version-amd64,http://truenas/pxeboot/k3os/v0.19.4/k3os-kernel-amd64.squashfs
  append ip=dhcp noipv6 ipv6.disable=1 k3os.mode=install k3os.install.device=/dev/sda k3os.install.no_format=false k3os.install.iso_url=https://github.com/rancher/k3os/releases/download/v0.19.4-dev.5/k3os-amd64.iso k3os.install.config_url=https://raw.githubusercontent.com/waigant/pxeboot/main/k3os/config.yml

Expected behavior

Actual behavior

Additional context

linuxmail commented 3 years ago

hi,

it works with rc1 :-) Tested a few minutes ago.

alexdepalex commented 3 years ago

I still have the same issue, but only on the first node that's provisioned using mode: create. After installation, when it boots for the first time, it has a random rancher hostname. When I reboot it again afterwards, it's renamed to the hostname which is provided through dhcp. After that, stuff breaks, because k3s is configured with the previous hostname.

These issues don't arise with joiner nodes.