KinD on WSL2-based Ubuntu 20.04.6 LTS: kind create cluster fails when "Writing configuration"

215 views Asked by At

I installed docker and kind on a WSL2-based Ubuntu 20.04.6 LTS like this:

$ curl -fsSL https://get.docker.com -o get-docker.sh
$ sudo sh get-docker.sh
$ sudo usermod -aG docker $USER

Then I added this to my .profile:

if grep -q "microsoft" /proc/version > /dev/null 2>&1; then
    if service docker status 2>&1 | grep -q "is not running"; then
        wsl.exe --distribution "${WSL_DISTRO_NAME}" --user root \
        --exec /usr/sbin/service docker start > /dev/null 2>&1
    fi
fi

and reopened my terminal session.

$ docker --version
Docker version 24.0.6, build ed223bc

No trouble with docker run hello-world Now I installed KinD like this:

$ [ $(uname -m) = x86_64 ] && curl -Lo ./kind https://kind.sigs.k8s.io/dl/v0.20.0/kind-linux-amd64
$ chmod +x ./kind
$ sudo mv ./kind /usr/local/bin/kind
$ kind --version
kind version 0.20.0

But then, when trying to create a cluster, this happens:

$ kind create cluster

Creating cluster "kind" ...
✓ Ensuring node image (kindest/node:v1.27.3) 
✓ Preparing nodes 
✗ Writing configuration 
Deleted nodes: ["kind-control-plane"]
ERROR: failed to create cluster: failed to copy kubeadm config to node: failed to create directory /kind: command "docker exec --privileged kind-control-plane mkdir -p /kind" failed with error: exit status 126
Command Output: OCI runtime exec failed: exec failed: unable to start container process: error executing setns process: exit status 1: unknown

What could be causing this?

I would have expected KinD to create a cluster

0

There are 0 answers