I was trying out latest k3d installed via go get. After k3d create the default traefik and coredns pods would stay in Pending state forever.
I found the following in kubectl describe for the pods:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 22s (x2 over 22s) default-scheduler no nodes available to schedule pods
Also kubectl get nodes would output
No resources found.
In the docker logs of the k3d-k3s_default container I also saw repeated messages of the following:
time="2019-05-08T15:04:00.196973262Z" level=info msg="waiting for node k3d-k3s_default-server: nodes \"k3d-k3s_default-server\" not found"
time="2019-05-08T15:04:02.198201809Z" level=info msg="waiting for node k3d-k3s_default-server: nodes \"k3d-k3s_default-server\" not found"
time="2019-05-08T15:04:04.199724009Z" level=info msg="waiting for node k3d-k3s_default-server: nodes \"k3d-k3s_default-server\" not found"
time="2019-05-08T15:04:06.201047753Z" level=info msg="waiting for node k3d-k3s_default-server: nodes \"k3d-k3s_default-server\" not found"
time="2019-05-08T15:04:08.202304466Z" level=info msg="waiting for node k3d-k3s_default-server: nodes \"k3d-k3s_default-server\" not found"
time="2019-05-08T15:04:10.203751445Z" level=info msg="waiting for node k3d-k3s_default-server: nodes \"k3d-k3s_default-server\" not found"
time="2019-05-08T15:04:12.205281191Z" level=info msg="waiting for node k3d-k3s_default-server: nodes \"k3d-k3s_default-server\" not found"
time="2019-05-08T15:04:14.208050701Z" level=info msg="waiting for node k3d-k3s_default-server: nodes \"k3d-k3s_default-server\" not found"
time="2019-05-08T15:04:16.209164570Z" level=info msg="waiting for node k3d-k3s_default-server: nodes \"k3d-k3s_default-server\" not found"
When I tried the latest release (v1.0.2) everything was working again. I did a quick bisect on the commits and it appears that the changes in 9ac81982e245b2b6ba3fc9d564b49917bbcd4f9e cause this behavior.
I think '_' is not allowed in a valid Unix host name. As a work around, you can try to create the cluster with the -n option.
For a proper fix, I suggest that 1) we change the default cluster name from 'k3s_default' to 'k3s-default'. 2) For the -n option, we only accept an argument in .valid hostname form.
Working on a pull request to implement the suggestion above.
Kinda embarrassing :sweat_smile:
I'll release a hotfix in a few minutes
Thanks for reporting this. As @andyz-dev suggested, I quickly changed the default name to k3s-default, so that it at least works with the defaults after go get/go install.
Thanks for working on this @andyz-dev , I'll merge your PR asap once I see it ready :+1:
Fixed via PR #35, thanks to @andyz-dev
Thank you @andyz-dev and @iwilltry42 for fixing this so quickly.
Most helpful comment
I think '_' is not allowed in a valid Unix host name. As a work around, you can try to create the cluster with the -n option.
For a proper fix, I suggest that 1) we change the default cluster name from 'k3s_default' to 'k3s-default'. 2) For the -n option, we only accept an argument in .valid hostname form.