I am following the kubernetes-the-hard-way to create the k8s cluster, since I don’t have ARM devices, I am using 4 vm with x86 architecture. That is the only different with the guide.
All steps went fine until chapter 09-bootstrapping-kubernetes-workers, the node is not getting ready:
"kubectl get nodes
--kubeconfig admin.kubeconfig"
NAME STATUS ROLES AGE VERSION
node-0 NotReady <none> 94s v1.31.2
node-1 NotReady <none> 98s v1.31.2
Further check by describe nodes, the root cause is KubeletHasSufficientMemory
Actually, the node shall have enough memory, and swap is turned off.
root@node-0:~# free -m
total used free shared buff/cache available
Mem: 1967 869 356 26 920 1097
Swap: 0 0 0
root@server:~# kubectl describe nodes --kubeconfig admin.kubeconfig
Name: node-0
Roles: <none>
Labels: beta.kubernetes.io/arch=amd64
beta.kubernetes.io/os=linux
kubernetes.io/arch=amd64
kubernetes.io/hostname=node-0
kubernetes.io/os=linux
Annotations: node.alpha.kubernetes.io/ttl: 0
volumes.kubernetes.io/controller-managed-attach-detach: true
CreationTimestamp: Sun, 15 Dec 2024 04:56:26 -0600
Taints: node.kubernetes.io/not-ready:NoSchedule
Unschedulable: false
Lease:
HolderIdentity: node-0
AcquireTime: <unset>
RenewTime: Sun, 15 Dec 2024 05:12:08 -0600
Conditions:
Type Status LastHeartbeatTime LastTransitionTime Reason Message
---- ------ ----------------- ------------------ ------ -------
MemoryPressure False Sun, 15 Dec 2024 05:11:55 -0600 Sun, 15 Dec 2024 04:56:26 -0600 KubeletHasSufficientMemory kubelet has
sufficient memory available
DiskPressure False Sun, 15 Dec 2024 05:11:55 -0600 Sun, 15 Dec 2024 04:56:26 -0600 KubeletHasNoDiskPressure kubelet has
no disk pressure
PIDPressure False Sun, 15 Dec 2024 05:11:55 -0600 Sun, 15 Dec 2024 04:56:26 -0600 KubeletHasSufficientPID kubelet has
sufficient PID available
Ready False Sun, 15 Dec 2024 05:11:55 -0600 Sun, 15 Dec 2024 04:56:26 -0600 KubeletNotReady container r
untime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initiali
zed
Addresses:
InternalIP: 192.168.122.26
Hostname: node-0
Capacity:
cpu: 1
ephemeral-storage: 19480400Ki
1
I found the reason, it is not a memory resource issue.
The actual error is Network plugin returns error: cni plugin not initialized
Ready False Sun, 15 Dec 2024 05:11:55 -0600 Sun, 15 Dec 2024 04:56:26 -0600 KubeletNotReady container r
untime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initiali
It turns out was I forget the step:
Create the bridge network configuration file:
mv 10-bridge.conf 99-loopback.conf /etc/cni/net.d/
After repeat this step, and restart the containerd kubelet kube-proxy
then the node status is Ready.