k3d
k3d copied to clipboard
[BUG]
What did you do
- How was the cluster created?
-
K3D_FIX_DNS=1 k3d cluster create "${K3D_CLUSTER_NAME}" \ --wait \ --volume "${script_dir}/k3sconfig.yml:/etc/rancher/k3s/config.yaml" \ --registry-use "k3d-${LOCAL_REGISTRY_NAME}:${LOCAL_REGISTRY_PORT}" \ --registry-config "${temp_reg}" \ --k3s-arg=--disable=traefik,servicelb,local-storage \ --k3s-arg=--secrets-encryption \ --k3s-arg=--cluster-init \ --k3s-arg=--kubelet-arg=cpu-cfs-quota=false \ --k3s-arg=--etcd-expose-metrics=true \ --k3s-arg="--kubelet-arg=eviction-hard=nodefs.available<100Mi,nodefs.inodesFree<100,imagefs.available<100Mi,imagefs.inodesFree<100,memory.available<100Mi" \ --k3s-arg="--kube-apiserver-arg=feature-gates=EphemeralContainers=true" \ --no-lb \ $docker_network_param \ --image "${K3D_IMAGE_REGISTRY}/${K3D_IMAGE_NAME}:${K3D_IMAGE_TAG}"
-
Versions used can be seen below in k3d info output.
- What did you do afterwards?
- I tried to add new node to the cluster: sudo k3d node create node2 --cluster "${K3D_CLUSTER_NAME}" --role server
What did you expect to happen
I expected the new node will join the cluster without an error. This bug should have been fixed in 5.0 version (if it is the same bug) as you can see here: https://github.com/k3d-io/k3d/issues/695
Screenshots or terminal output
`INFO[0027] Updating loadbalancer config to include new server node(s) panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xa30205]
goroutine 35 [running]: github.com/k3d-io/k3d/v5/pkg/runtimes/docker.Docker.ReadFromNode({}, {0xf49520, 0xc00042a540}, {0xdded0a, 0x16}, 0x0) /home/runner/work/k3d/k3d/pkg/runtimes/docker/util.go:160 +0xc5 github.com/k3d-io/k3d/v5/pkg/client.GetLoadbalancerConfig({0xf49520, 0xc00042a540}, {0xf57d68?, 0x1528898?}, 0xc0000b4100) /home/runner/work/k3d/k3d/pkg/client/loadbalancer.go:132 +0x336 github.com/k3d-io/k3d/v5/pkg/client.UpdateLoadbalancerConfig({0xf49520, 0xc00042a540}, {0xf57d68?, 0x1528898?}, 0x1?) /home/runner/work/k3d/k3d/pkg/client/loadbalancer.go:61 +0x17f github.com/k3d-io/k3d/v5/pkg/client.NodeAddToCluster({0xf49520, 0xc00042a540}, {0xf57d68?, 0x1528898?}, 0xc000107ba0, 0xc0000b4100?, {0x1, 0x0, {0xc000046480, 0x2, ...}, ...}) /home/runner/work/k3d/k3d/pkg/client/node.go:261 +0x17bb github.com/k3d-io/k3d/v5/pkg/client.NodeAddToClusterMulti.func1() /home/runner/work/k3d/k3d/pkg/client/node.go:316 +0x57 golang.org/x/sync/errgroup.(*Group).Go.func1() /home/runner/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:74 +0x64 created by golang.org/x/sync/errgroup.(*Group).Go /home/runner/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:71 +0xa5`
Which OS & Architecture
-
arch: x86_64 cgroupdriver: systemd cgroupversion: "2" endpoint: /var/run/docker.sock filesystem: extfs name: docker os: Ubuntu 22.04.1 LTS ostype: linux version: 20.10.22
Which version of k3d
-
k3d version v5.4.6 k3s version v1.24.4-k3s1 (default)
Which version of docker
`Client: Docker Engine - Community Version: 20.10.22 API version: 1.41 Go version: go1.18.9 Git commit: 3a2c30b Built: Thu Dec 15 22:28:04 2022 OS/Arch: linux/amd64 Context: default Experimental: true
Server: Docker Engine - Community Engine: Version: 20.10.22 API version: 1.41 (minimum version 1.12) Go version: go1.18.9 Git commit: 42c8b31 Built: Thu Dec 15 22:25:49 2022 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.14 GitCommit: 9ba4b250366a5ddde94bb7c9d1def331423aa323 runc: Version: 1.1.4 GitCommit: v1.1.4-0-g5fd4c4d docker-init: Version: 0.19.0 GitCommit: de40ad0 `
`Client: Context: default Debug Mode: false Plugins: app: Docker App (Docker Inc., v0.9.1-beta3) buildx: Docker Buildx (Docker Inc., v0.9.1-docker) compose: Docker Compose (Docker Inc., v2.13.0) scan: Docker Scan (Docker Inc., v0.23.0)
Server: Containers: 4 Running: 2 Paused: 0 Stopped: 2 Images: 24 Server Version: 20.10.22 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true userxattr: false Logging Driver: json-file Cgroup Driver: systemd Cgroup Version: 2 Plugins: Volume: local Network: bridge host ipvlan macvlan null overlay Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog Swarm: inactive Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc Default Runtime: runc Init Binary: docker-init containerd version: 9ba4b250366a5ddde94bb7c9d1def331423aa323 runc version: v1.1.4-0-g5fd4c4d init version: de40ad0 Security Options: apparmor seccomp Profile: default cgroupns Kernel Version: 5.15.0-56-generic Operating System: Ubuntu 22.04.1 LTS OSType: linux Architecture: x86_64 CPUs: 8 Total Memory: 15.59GiB Name: amir2204 ID: 7XH3:GM4D:B6KO:BISK:AXUI:AHDF:XWIE:ZCXI:2MSJ:RZRF:ZYXD:ODO3 Docker Root Dir: /var/lib/docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false `
having the same error, works in 5.4.7
, does not work in 5.4.8
.
Reproducing:
k3d cluster create kuma-1
k3d node create second -c kuma-1 --k3s-node-label second=true
having the same error in 5.4.9, works in 5.4.7
INFO[0035] HostIP: using network gateway 1.2.3.4 address
panic: runtime error: index out of range [-1]
goroutine 8 [running]:
github.com/k3d-io/k3d/v5/pkg/client.NodeAddToCluster({0xf6c198, 0xc0002b8050}, {0xf7b2b0?, 0x156de50?}, 0xc0000de1a0, 0xc0000e6100?, {0x1, 0x0, {0x0, 0x0, ...}, ...})
/home/runner/work/k3d/k3d/pkg/client/node.go:200 +0x20c8
github.com/k3d-io/k3d/v5/pkg/client.NodeAddToClusterMulti.func1()
/home/runner/work/k3d/k3d/pkg/client/node.go:346 +0x57
golang.org/x/sync/errgroup.(*Group).Go.func1()
/home/runner/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:75 +0x64
created by golang.org/x/sync/errgroup.(*Group).Go
/home/runner/go/pkg/mod/golang.org/x/[email protected]/errgroup/errgroup.go:72 +0xa5
```