kind: Create cluster fails - kind-control-plane does not work on zfs

What happened: cluster create failed

failed to create cluster: failed to init node with kubeadm: command "docker exec --privileged kind-control-plane kubeadm init --ignore-preflight-errors=all --config=/kind/kubeadm.conf --skip-token-print --v=6" failed with error: exit status 1

What you expected to happen: successful cluster creation

How to reproduce it (as minimally and precisely as possible):

$ kind create cluster 

Anything else we need to know?:

I’m using ZFS. I have read the other (now closed as resolved) issue about using zfs and I can see that /dev/mapper is bind-mounted into the kind-control-plane container. I’m running 0.8.1 so I believe that I should have the version that should work with ZFS.

Environment:

  • kind version: (use kind version): kind v0.8.1 go1.14.2 linux/amd64

  • Kubernetes version: (use kubectl version): Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.2", GitCommit:"52c56ce7a8272c798dbc29846288d7cd9fbae032", GitTreeState:"archive", BuildDate:"2020-04-23T22:11:11Z", GoVersion:"go1.14.2", Compiler:"gc", Platform:"linux/amd64"}

  • Docker version: (use docker info): Server Version: 19.03.8-ce containerd version: d76c121f76a5fc8a462dc64594aea72fe18e1178.m

  • OS (e.g. from /etc/os-release): Arch Linux 5.6.11-arch1-1 #1 SMP PREEMPT Wed, 06 May 2020 17:32:37 +0000 x86_64 GNU/Linux

To capture more information, I ran with kind create cluster --loglevel=debug --retain. Here is some further log data…

In kind-control-plane/containerd.log

Jul 08 12:53:09 kind-control-plane containerd[127]: time="2020-07-08T12:53:09.553579553Z" level=error msg="RunPodSandbox for &PodSandboxMetadata{Name:kube-apiserver-kind-control-plane,Uid:350cc499f8fb9468ea828e0b13035d50,Namespace:kube-system,Attempt:0,} failed, error" error="failed to create containerd task: failed to mount rootfs component &{overlay overlay [workdir=/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/82/work upperdir=/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/82/fs lowerdir=/var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/1/fs]}: invalid argument: unknown"

Also it appears to be trying to use zfs but doesn’t have the zfs executable:

Jul 09 14:57:36 kind-control-plane containerd[161]: time="2020-07-09T14:57:36.850165016Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.zfs\"..." type=io.containerd.snapshotter.v1
Jul 09 14:57:36 kind-control-plane containerd[161]: time="2020-07-09T14:57:36.850516545Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.zfs" error="exec: \"zfs\": executable file not found in $PATH: \"zfs fs list -Hp -o name,origin,used,available,mountpoint,compression,type,volsize,quota,referenced,written,logicalused,usedbydataset system/storage/docker\" => "
Jul 09 14:57:36 kind-control-plane containerd[161]: time="2020-07-09T14:57:36.850555778Z" level=info msg="loading plugin \"io.containerd.metadata.v1.bolt\"..." type=io.containerd.metadata.v1
Jul 09 14:57:36 kind-control-plane containerd[161]: time="2020-07-09T14:57:36.850594684Z" level=warning msg="could not use snapshotter zfs in metadata plugin" error="exec: \"zfs\": executable file not found in $PATH: \"zfs fs list -Hp -o name,origin,used,available,mountpoint,compression,type,volsize,quota,referenced,written,logicalused,usedbydataset system/storage/docker\" => "

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 21 (12 by maintainers)

Most upvoted comments

so setting the snapshotter to zfs doesn’t work (it complains about a missing metadata.db when actually trying to take snapshots). however, I noticed this from the microk8s project: https://github.com/ubuntu/microk8s/commit/a5ec1f9540dbc6500e39dbdf30c79027f8e99239#diff-e263cbd0de8da1f880f701684ae8b035R35-R36

and sure enough,

cat <<EOF | kind create cluster --config=-                                 
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
containerdConfigPatches:
- |-
 [plugins."io.containerd.grpc.v1.cri".containerd]
 snapshotter = "native"
EOF

works without modifying the base image.

I finally got around to being able to test this. Using the above config snippet, it worked for me. I haven’t gone further than firing it up and running a nginx hello example but it appears to work.

it’s relatively safe to go ahead and try from HEAD, kind.sigs.k8s.io/dl/latest/kind-linux-amd64 has prebuild nightly binaries (not intended for stable third party use, but kubernetes CI internally uses this), or you can make build (~zero dependencies) and use bin/kind from a clone.

On Tue, Sep 1, 2020 at 1:20 AM Benjamin Elder bentheelder@google.com wrote:

the last fix PR is out right now (WIP) so probably tomorrow. took al little longer than expected.

On Tue, Sep 1, 2020 at 1:15 AM johnlane notifications@github.com wrote:

@BenTheElder https://github.com/BenTheElder was hoping to test 0.9.0 over the weekend, any idea if that’s going to be published soon? I might have some time this week to do a test.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kubernetes-sigs/kind/issues/1719#issuecomment-684548136, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHADKYBUHOELSEIFFHIRPDSDSUT3ANCNFSM4OVTXEMA .

I can’t actually verify this myself at the moment but a fix based on this thread should be in v0.9.0 (later today?)