cnrancher / autok3s

Run K3s Everywhere
https://www.suse.com
Apache License 2.0
741 stars 76 forks source link

[BUG] 使用k3d provider时出现K3D错误 #634

Closed putao520 closed 11 months ago

putao520 commented 11 months ago

time="2023-08-31T14:50:46Z" level=info msg="[k3d] begin to create cluster xxx..." time="2023-08-31T14:50:46Z" level=info msg="[k3d] 1 masters and 0 workers will be added" time="2023-08-31T14:50:46Z" level=info msg="Prep: Network" time="2023-08-31T14:50:46Z" level=info msg="Re-using existing network 'k3d-xxx' (a2546b88fc9896bc32f842dac4a7546d09255d59f6e8cd5d35afc5405d345650)" time="2023-08-31T14:50:46Z" level=info msg="Created image volume k3d-xxx-images" time="2023-08-31T14:50:46Z" level=info msg="Starting new tools node..." time="2023-08-31T14:50:46Z" level=info msg="Starting Node 'k3d-xxx-tools'" time="2023-08-31T14:50:47Z" level=info msg="Creating node 'k3d-xxx-server-0'" time="2023-08-31T14:50:47Z" level=info msg="Creating LoadBalancer 'k3d-xxxserverlb'" time="2023-08-31T14:50:47Z" level=info msg="Using the k3d-tools node to gather environment information" time="2023-08-31T14:50:48Z" level=info msg="HostIP: using network gateway 172.18.0.1 address" time="2023-08-31T14:50:48Z" level=info msg="Starting cluster 'xxx'" time="2023-08-31T14:50:48Z" level=info msg="Starting servers..." time="2023-08-31T14:50:48Z" level=info msg="Starting Node 'k3d-xxx-server-0'" time="2023-08-31T14:50:57Z" level=info msg="All agents already running." time="2023-08-31T14:50:57Z" level=info msg="Starting helpers..." time="2023-08-31T14:50:58Z" level=info msg="Starting Node 'k3d-xxx-serverlb'" time="2023-08-31T14:51:05Z" level=info msg="Injecting records for hostAliases (incl. host.k3d.internal) and for 2 network members into CoreDNS configmap..." time="2023-08-31T14:51:06Z" level=error msg="[k3d] cluster xxx run failed: Failed Cluster Start: error during post-start cluster preparation: error overwriting contents of /etc/hosts: docker failed to attach to exec process in node 'k3d-xxx-server-0': http: invalid Host header" time="2023-08-31T14:51:06Z" level=warning msg="[k3d] skip executing rollback logic. This is only used for troubleshooting, the instances and cluster is out of control by AutoK3s. Please check K3s error log and uninstalled manually if needed."

JacieChao commented 11 months ago

Please provide more detailed information as the issue template mentions will be more helpful.

It seems like a docker issue from the log shows.

putao520 commented 11 months ago

好像是go版本问题导致http: invalid Host header错误

D-WadeLv commented 11 months ago

好像是go版本问题导致http: invalid Host header错误

I also met the problem, downgrade the autok3s version can soulve it

JacieChao commented 11 months ago

@D-WadeLv Which version of AutoK3s are you facing this issue? Could you please provide more detailed information?

D-WadeLv commented 11 months ago

@D-WadeLv Which version of AutoK3s are you facing this issue? Could you please provide more detailed information? Now I use Autok3s v0.6.0, it works sucessfully. You can download packages of your OS and wannted version

JacieChao commented 11 months ago

I can't help more without any useful information. The k3d provider works fine with AutoK3s v0.9.0 with docker v20.10.12 on MacOS M1 and also works fine on Ubuntu 22.04.

D-WadeLv commented 11 months ago

I can't help more without any useful information. The k3d provider works fine with AutoK3s v0.9.0 with docker v20.10.12 on MacOS M1 and also works fine on Ubuntu 22.04.

The version as you say cannot works in my Ubuntu22.04, I want to download AutoK3s v0.6.0 by shell like "curl -sS https://rancher-mirror.rancher.cn/autok3s/install.sh | INSTALL_AUTOK3S_MIRROR=cn sh", can you tell me how to edit the shell?

orangedeng commented 11 months ago

we might need to upgrade Golang version to v1.20.8+.

orangedeng commented 11 months ago

I can reproduce this issue with ubuntu 22.04 and autok3s v0.9.0. And after upgrade to v1.20.8, this problem will be resolved. Already tested in my dev environment.

JacieChao commented 11 months ago

Validate with v0.9.1 Ubuntu 22.04 + docker 24.0.6. Close as complete. Please upgrade to v0.9.1 to resolve this issue and feel free to reopen it if the issue still exists.