Kind (Kubernetes in Docker) is a tool used to run a lightweight Kubernetes cluster locally inside Docker containers.
It is a great platform for learning real Kubernetes behavior because clusters can be spun up easily using a single command. In this blog, we will discuss an error that occurred while creating a Kind cluster for the first time and how to resolve it.
Pre-requisites:
When creating a Kind cluster, we encountered the following error.
Creating cluster "kind" ...
• Ensuring node image (kindest/node:v1.35.0) 🖼 ...
✓ Ensuring node image (kindest/node:v1.35.0) 🖼
• Preparing nodes 📦 ...
✓ Preparing nodes 📦
• Writing configuration 📜 ...
✓ Writing configuration 📜
• Starting control-plane 🕹️ ...
✗ Starting control-plane 🕹️
Deleted nodes: ["kind-control-plane"]
ERROR: failed to create cluster: failed to init node with kubeadm: command "docker exec --privileged kind-control-plane kubeadm init --config=/kind/kubeadm.conf --skip-token-print --v=6" failed with error: exit status 1
------
------
[wait-control-plane] Waiting for the kubelet to boot up the control plane as static Pods from directory "/etc/kubernetes/manifests"
[kubelet-check] Waiting for a healthy kubelet at http://127.0.0.1:10248/healthz. This can take up to 4m0s
error: error execution phase wait-control-plane: failed while waiting for the kubelet to start:
The error indicates that the kubelet failed to become healthy within the 4-minute timeout. The kubelet is the Kubernetes agent that runs on each node, and it was not responding to health checks.One of the reasons for this failure is that Docker Desktop does not have enough CPU or memory allocated.
The fix is to allocate enough resources to Docker Desktop as required by Kind. For smooth performance, allocate at least 4 CPU cores and 8 GB of RAM.
After allocating sufficient resources, retry creating the cluster. You should be able to see that the cluster is up and running.
After allocating sufficient resources, retry creating the cluster. You should be able to see that the cluster is up and running.
No comments:
Post a Comment