Description
In some situations with slow hardware or network, when K8s is deployed using CAPI with kubeadm (using the Flatcar bakery kubernetes sysext), on reboots, kubelet starts and sees the hostname as localhost instead of the correct hostname. When kubelet sees the hostname as localhost, the process just hangs with an error message, as kubelet does not recognise itself because, in the K8s database, the node has the actual hostname.
There is a possible culprit for this: systemd-hostnamed starts or finishes the hostname set after kubelet start. Adding a Wants/Required in the kubelet systemd unit for the Kubernetes systemd sysext might solve this issue.
Impact
Kubelet process does not recognise itself and does nothing until the process gets restarted.
Environment and steps to reproduce
Deploy kubernetes using the kubernetes sysext from Flatcar bakery. Reboot a node. There is a chance this issue appears.
Expected behavior
Kubelet should start after the systemd units responsible with the hostname set.
Description
In some situations with slow hardware or network, when K8s is deployed using CAPI with kubeadm (using the Flatcar bakery kubernetes sysext), on reboots, kubelet starts and sees the hostname as
localhostinstead of the correct hostname. When kubelet sees the hostname aslocalhost, the process just hangs with an error message, as kubelet does not recognise itself because, in the K8s database, the node has the actual hostname.There is a possible culprit for this: systemd-hostnamed starts or finishes the hostname set after kubelet start. Adding a Wants/Required in the kubelet systemd unit for the Kubernetes systemd sysext might solve this issue.
Impact
Kubelet process does not recognise itself and does nothing until the process gets restarted.
Environment and steps to reproduce
Deploy kubernetes using the kubernetes sysext from Flatcar bakery. Reboot a node. There is a chance this issue appears.
Expected behavior
Kubelet should start after the systemd units responsible with the hostname set.