Closed blaisep-vgs closed 4 years ago
Hi @blaisep-vgs , thanks for opening this issue! :)
Follow-Up question: what do you have at $(pwd)
that you mount to the manifests folder?
Since you're mounting a whole folder, you're overwriting everything that k3s usually deploys (like CoreDNS, etc.).
You may want to mount to a subfolder instead, e.g. --volume "$(pwd):/var/lib/rancher/k3s/server/manifests/mystuff"
.
Also, for debugging purposes, can you please do a docker ps -a
and a docker logs k3d-k3s-default-server-0
and post the output here?
The nil pointer exception will probably already be fixed by b5eeda7 .. can you build from main
branch and try again?
If you want, I can also build it for you and link you to the executable for download.
Hi @iwilltry42 , thanks for the suggestions, I will build from main
and follow the new instructions re logs and volume mounts.
@iwilltry42 I think you can close this issue now.
I built from main
(b5eeda74d61788328e7ac513078d2ada4644f6d0) and fully qualified the volume mount.
It works now, using the instructions in the docs. :
$ k3d cluster create --agents 2 --api-port 6550 -p "8081:80@loadbalancer" --k3s-server-arg '--flannel-backend=none' --volume "$(pwd)/docs/usage/guides/calico.yaml:/var/lib/rancher/k3s/server/manifests/calico.yaml"
WARN[0000] No node filter specified
INFO[0000] Created network 'k3d-k3s-default'
INFO[0000] Created volume 'k3d-k3s-default-images'
INFO[0001] Creating node 'k3d-k3s-default-server-0'
INFO[0002] Pulling image 'docker.io/rancher/k3s:v1.18.9-k3s1'
INFO[0022] Creating node 'k3d-k3s-default-agent-0'
INFO[0022] Creating node 'k3d-k3s-default-agent-1'
INFO[0022] Creating LoadBalancer 'k3d-k3s-default-serverlb'
INFO[0024] Pulling image 'docker.io/rancher/k3d-proxy:v3.1.5'
INFO[0027] (Optional) Trying to get IP of the docker host and inject it into the cluster as 'host.k3d.internal' for easy access
INFO[0034] Successfully added host record to /etc/hosts in 4/4 nodes and to the CoreDNS ConfigMap
INFO[0034] Cluster 'k3s-default' created successfully!
That's great 🙂 I guess it also works without the custom build? Still nice that you found that edge case we could fix now 👍
@iwilltry42 , yes, it also works with the standard build using install.sh I tried both methods.
What did you do
goroutine 1 [running]: github.com/rancher/k3d/v3/pkg/runtimes/docker.Docker.ExecInNodeGetLogs(0x4d155e0, 0xc00003c190, 0xc0003d5e00, 0xc000ea34a0, 0x3, 0x3, 0x4a64240, 0xc000c15c01, 0xc000ea34a0) github.com/rancher/k3d/v3/pkg/runtimes/docker/node.go:311 +0x79 github.com/rancher/k3d/v3/pkg/cluster.resolveHostnameFromInside(0x4d155e0, 0xc00003c190, 0x4d25380, 0x52ff700, 0xc0003d5e00, 0x4bde2f7, 0x14, 0x41f9305, 0xc0000bc040, 0x4bc1040, ...) github.com/rancher/k3d/v3/pkg/cluster/host.go:79 +0x17a github.com/rancher/k3d/v3/pkg/cluster.GetHostIP(0x4d155e0, 0xc00003c190, 0x4d25380, 0x52ff700, 0xc000428900, 0x0, 0x0, 0x0, 0x0, 0x0) github.com/rancher/k3d/v3/pkg/cluster/host.go:60 +0x17e github.com/rancher/k3d/v3/pkg/cluster.ClusterCreate(0x4d155e0, 0xc00003c190, 0x4d25380, 0x52ff700, 0xc000428900, 0x0, 0x0) github.com/rancher/k3d/v3/pkg/cluster/cluster.go:360 +0x1935 github.com/rancher/k3d/v3/cmd/cluster.NewCmdClusterCreate.func1(0xc000414b00, 0xc0003d8b00, 0x0, 0x8) github.com/rancher/k3d/v3/cmd/cluster/clusterCreate.go:83 +0x14c github.com/spf13/cobra.(Command).execute(0xc000414b00, 0xc0003d8a80, 0x8, 0x8, 0xc000414b00, 0xc0003d8a80) github.com/spf13/cobra@v1.0.1-0.20200629195214-2c5a0d300f8b/command.go:846 +0x2c2 github.com/spf13/cobra.(Command).ExecuteC(0x52bfd40, 0xc0000320c0, 0xa, 0xa) github.com/spf13/cobra@v1.0.1-0.20200629195214-2c5a0d300f8b/command.go:950 +0x375 github.com/spf13/cobra.(*Command).Execute(...) github.com/spf13/cobra@v1.0.1-0.20200629195214-2c5a0d300f8b/command.go:887 github.com/rancher/k3d/v3/cmd.Execute() github.com/rancher/k3d/v3/cmd/root.go:91 +0x5a main.main() github.com/rancher/k3d/v3/main.go:27 +0x25
$ k3d cluster create --api-port 6550 -p "8081:80@loadbalancer" --k3s-server-arg '--flannel-backend=none' --volume "$(pwd):/var/lib/rancher/k3s/server/manifests" WARN[0000] No node filter specified INFO[0000] Created network 'k3d-k3s-default' INFO[0000] Created volume 'k3d-k3s-default-images' INFO[0001] Creating node 'k3d-k3s-default-server-0' INFO[0012] Creating LoadBalancer 'k3d-k3s-default-serverlb' INFO[0013] (Optional) Trying to get IP of the docker host and inject it into the cluster as 'host.k3d.internal' for easy access INFO[0017] Successfully added host record to /etc/hosts in 2/2 nodes and to the CoreDNS ConfigMap INFO[0017] Cluster 'k3s-default' created successfully!