Skip to content

Kubernetes kubelet service starts with hostname set to localhost #161

@ader1990

Description

@ader1990

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status

    📝 Needs Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions