Richard Rublev
Richard Rublev

Reputation: 8182

Why multinode Kind cluster creation failed?

This works fine

kind create cluster --name newl

kubectl cluster-info --context kind-newl
Kubernetes control plane is running at https://127.0.0.1:33933
CoreDNS is running at https://127.0.0.1:33933/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

But my yaml multi-node failed

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
- role: worker

I got error

ERROR: failed to create cluster: failed to join node with kubeadm: command "docker exec --privileged mmulti-node-worker kubeadm join --config /kind/kubeadm.conf --skip-phases=preflight --v=6" failed with error: exit status 1
Command Output: I0727 10:09:26.061729     249 join.go:413] [preflight] found NodeName empty; using OS hostname as NodeName
I0727 10:09:26.061754     249 joinconfiguration.go:76] loading configuration from "/kind/kubeadm.conf"
I0727 10:09:26.062531     249 controlplaneprepare.go:220] [download-certs] Skipping certs download
I0727 10:09:26.062544     249 join.go:530] [preflight] Discovering cluster-info
I0727 10:09:26.062557     249 token.go:80] [discovery] Created cluster-info discovery client, requesting info from "mmulti-node-control-plane:6443"

At the end

Unfortunately, an error has occurred:
    timed out waiting for the condition

This error is likely caused by:
    - The kubelet is not running
    - The kubelet is unhealthy due to a misconfiguration of the node in some way (required cgroups disabled)

systemctl status kubelet shows
● kubelet.service - kubelet: The Kubernetes Node Agent
     Loaded: loaded (/lib/systemd/system/kubelet.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/kubelet.service.d
             └─10-kubeadm.conf
     Active: activating (auto-restart) (Result: exit-code) since Wed 2022-07-27 12:17:57 CEST; 9s ago
       Docs: https://kubernetes.io/docs/home/
    Process: 60094 ExecStart=/usr/bin/kubelet $KUBELET_KUBECONFIG_ARGS $KUBELET_CONFIG_ARGS $KUBELET_KUBEADM_ARGS $KUBELET_EXTRA_ARGS (code=exited, sta>
   Main PID: 60094 (code=exited, status=1/FAILURE)

I thought that something has to do with 1.24 dropping dockershim.I am not sure about that.

How it comes that I can make cluster in the first case and fails in second?

Upvotes: 2

Views: 1204

Answers (1)

TCH
TCH

Reputation: 46

The following commands have to be executed, link: https://github.com/kubernetes-sigs/kind/issues/2744#issuecomment-1127808069

echo fs.inotify.max_user_watches=655360 | sudo tee -a /etc/sysctl.conf
echo fs.inotify.max_user_instances=1280 | sudo tee -a /etc/sysctl.conf
sudo sysctl -p

Upvotes: 3

Related Questions