kind: WSL2 ERROR: `kind create cluster` fails on Starting control-plane
What happened:
On WSL2 (Ubuntu-22.04), creation of kind cluster using:
kind create cluster
failed on:
ERROR: failed to create cluster: failed to init node with kubeadm: command "docker exec --privileged kind-control-plane kubeadm init --skip-phases=preflight --config=/kind/kubeadm.conf --skip-token-print --v=6" failed with error: exit status 1
PLease note: It used to work fine last week!
Logs attached: 3165244420.zip
What you expected to happen:
Creating cluster โkindโ โฆ โ Ensuring node image (kindest/node:v1.26.3) ๐ผ โ Preparing nodes ๐ฆ ๐ฆ โ Writing configuration ๐ โ Starting control-plane ๐น๏ธ โ Installing CNI ๐ โ Installing StorageClass ๐พ โ Joining worker nodes ๐ Set kubectl context to โkind-kindโ You can now use your cluster with:
kubectl cluster-info --context kind-kind
Thanks for using kind! ๐
How to reproduce it (as minimally and precisely as possible):
kind create cluster
Anything else we need to know?:
Environment:
- kind version: (use
kind version
): kind v0.18.0 go1.20.2 linux/amd64 - Runtime info: (use
docker info
orpodman info
):
Client: Context: default Debug Mode: false Plugins: buildx: Docker Buildx (Docker Inc.) Version: v0.10.4 Path: /usr/libexec/docker/cli-plugins/docker-buildx compose: Docker Compose (Docker Inc.) Version: v2.17.2 Path: /usr/libexec/docker/cli-plugins/docker-compose
Server: Containers: 65 Running: 3 Paused: 0 Stopped: 62 Images: 101 Server Version: 23.0.3 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Using metacopy: false 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 runc Default Runtime: runc Init Binary: docker-init containerd version: 2806fc1057397dbaeefbea0e4e17bddfbd388f38 runc version: v1.1.5-0-gf19387a init version: de40ad0 Security Options: seccomp Profile: builtin cgroupns Kernel Version: 5.15.90.1-microsoft-standard-WSL2 Operating System: Ubuntu 22.04.2 LTS OSType: linux Architecture: x86_64 CPUs: 14 Total Memory: 54.92GiB Name: w-PF42KZH6 ID: ITXK:IZJO:LRJS:ZZ5M:FYBZ:3ZJN:HRD7:AOLG:O7SA:SFZT:AZHX:7UDC Docker Root Dir: /var/lib/docker Debug Mode: false Registry: https://index.docker.io/v1/ Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false Default Address Pools: Base: 10.180.128.0/17, Size: 22
- OS (e.g. from
/etc/os-release
):
PRETTY_NAME=โUbuntu 22.04.2 LTSโ NAME=โUbuntuโ VERSION_ID=โ22.04โ VERSION=โ22.04.2 LTS (Jammy Jellyfish)โ VERSION_CODENAME=jammy ID=ubuntu ID_LIKE=debian HOME_URL=โhttps://www.ubuntu.com/โ SUPPORT_URL=โhttps://help.ubuntu.com/โ BUG_REPORT_URL=โhttps://bugs.launchpad.net/ubuntu/โ PRIVACY_POLICY_URL=โhttps://www.ubuntu.com/legal/terms-and-policies/privacy-policyโ UBUNTU_CODENAME=jammy
- Kubernetes version: (use
kubectl version
):
Client Version: version.Info{Major:โ1โ, Minor:โ24โ, GitVersion:โv1.24.3โ, GitCommit:โaef86a93758dc3cb2c658dd9657ab4ad4afc21cbโ, GitTreeState:โcleanโ, BuildDate:โ2022-07-13T14:30:46Zโ, GoVersion:โgo1.18.3โ, Compiler:โgcโ, Platform:โlinux/amd64โ} Kustomize Version: v4.5.4 Server Version: version.Info{Major:โ1โ, Minor:โ25โ, GitVersion:โv1.25.6โ, GitCommit:โff2c119726cc1f8926fb0585c74b25921e866a28โ, GitTreeState:โcleanโ, BuildDate:โ2023-01-18T19:15:26Zโ, GoVersion:โgo1.19.5โ, Compiler:โgcโ, Platform:โlinux/amd64โ}
- Any proxies or other special environment settings?:
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 15 (8 by maintainers)
Thanks,
in
/etc/docker/daemon.json
solved the problem, it seems.After setting that value, restarting docker service, pruning docker system (just to make sure) and restarting WSL, kind cluster can successfully be created ๐
Phew, ok, so it is just a bug in WSL ๐ Thank you for confirming!
So to clarify: WSL2 1.2.0.0 has this and a fix is in 1.2.3/1.2.4 preview? I think we need to pin an issue outlining the situation and fix.
Thatโs, of course, much better solution and it works like a charm even with default
--cgroupns=private
!Thanks a lot!
Here is a solution i found to a similar error while trying to run โkind create clusterโ
I am running WSL2, but got the same error the op mentioned.
After some frustration trying to find a solution (and some help from ChatGPT), i was able to solve with the following process:
docker run -it --privileged --name kind-control-plane kindest/node:v1.27.3
Check the container logs:
docker logs kind-control-plane
If the container starts successfully, stop and remove it:
Retry creating the Kind cluster:
kind create cluster
If successful, check the logs:
docker logs kind-control-plane
The key point is was to manually create the kind-control-plane container.
Hope this helps.
Thank you! For now Iโm pinning https://github.com/kubernetes-sigs/kind/issues/3180 to the top of the issue tracker outlining the situation and linking back to this and https://github.com/kubernetes-sigs/kind/issues/3165#issuecomment-1513665114
Yes, after I ran
wsl --update --pre-release
, my WSL was updated from 1.2.0.0 to 1.2.4.0. Then I removed the workaround from/etc/docker/daemon.json
, restarted docker and it works.