-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Indefinite wait on host with uppercase hostname #160
Comments
@aaliddell PR is welcomed. I can then put it into a rc build and then you can see if it fully works end to end. |
Ok it'll be up shortly. However, I'm not managing to get k3s to build locally with go presently, so the PR will be somewhat blind as to whether build succeeds... |
Seemingly resolved in 0.2.0rc5 Output is:
After these lines, there is no more output, the node is available and the dns pod starts. However, the helm pod does not start, with a DNS resolution failure in its logs, which I'm not sure is related? |
That does seem concerning. I'd probably say this isn't fully resolved quite yet. Might be another place the hostname matters. |
After a reboot, all pods come up successfully. I shall test on a totally clean machine to see if it was just something lingering from a previous failure. |
On a totally fresh install on a machine with an uppercase hostname, everything comes up sucessfully. |
Awesome thanks! I'll mark this resolved. |
Steps taken to test:
Looks like traefik is failing for reasons besides hostname
|
Describe the bug
On kubernetes, nodes with upper case hostnames are not permitted: kubernetes/kubernetes#71140
When running with k3s, the hostname appears to get converted to lower case inconsistently before the agent is started, in order to comply with the above constraint and the node successfully registers. However, k3s then waits indefinitely for the upper case version of the name here: https://github.com/rancher/k3s/blob/10f15535644453c5a55e786e6242ae27cc8e005e/pkg/agent/flannel/setup.go#L76
This may be associated with the issues people are seeing regarding #91
To Reproduce
Use a system with an uppercase hostname. e.g. in this example hostname = VM
The node succesfully starts with lowercase name:
But all pods are stuck on ContainerCreating, as k3s is waiting for the node to come up:
Looking at the output from
journalctl -u k3s
, we can see that it is waiting for the uppercase node name that will never appear:Expected behavior
Use consistent naming to ensure k3s is waiting for the correct name to start.
Perhaps convert to lower case just after hostname is retrieved: https://github.com/rancher/k3s/blob/4f13bd6eecb6202f4a5de7cc0d086a469e30e8f0/pkg/agent/config/config.go#L143
If desired I can add a PR to add this, but it's effectively a one liner:
Although care needs to be taken to also ensure that if an uppercase NODE_NAME env is passed, this is also fixed or raises an error: https://github.com/rancher/k3s/blob/4f13bd6eecb6202f4a5de7cc0d086a469e30e8f0/pkg/agent/config/config.go#L197The text was updated successfully, but these errors were encountered: