kubadm init error CPUs 1 is less than required 2 kubadm init error CPUs 1 is less than required 2 kubernetes kubernetes

kubadm init error CPUs 1 is less than required 2


Kubeadm runs a series of pre-flight checks to validate the system state before making changes.This error means the host don't have minimum requirement of 2 CPU. You can ignore the error if you still want to go ahead and install kubernetes on this host.

kubeadm init --ignore-preflight-errors=NumCPU


The reason this is occurring is because the hardware on which you are installing Kubernetes does not have enough resources. The developers in the Kubernetes community have mutually agreed that running Kubernetes with less than 2 CPU Cores is not advisable.

This is because in order to run Kubernetes you have to account for a certain amount of overhead. And, when doing so, if you have a system with a very small amount of compute power you will not be able to properly run applications simultaneously.

@Arghya is correct. You can opt to circumvent this by ignoring the Pre-Flight check that evaluates the capabilities of your hardware before installing the software. However, this is not advisable due to what I explained above.

If you're curious about learning more about how CPU cores relate to Kubernetes and Linux Containers, here is some really good documentation. In a nutshell, a Linux Container is effectively a process that is partitioned off from the rest of the operating system by what is known as a Kernel Namespace. Furthermore, this process can have limitations or requirements set around the amount of memory and cpu it can consume by using Control Groups.

When running a Linux Container in Kubernetes, the Kubernetes API Server schedules pods on worker nodes based on their available resources. If a Pod requires 200m of CPU, for example, then you would have already allocated 20% of your hardware to a single process running on it. See how much this can impact the required overhead to run the software? Kubernetes itself provisions half a dozen pods just to run. All of which have CPU Limitations and Requests specified.

Here is a good doc if you want to learn more about how CPU resources are applied to containerized processes with Linux cgroups.


You can ignore this error as mentioned in error output as well.

preflight] Running pre-flight checks[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/error execution phase preflight: [preflight] Some fatal errors occurred:[ERROR NumCPU]: the number of available CPUs 1 is less than the required 2[preflight] If you know what you are doing, you can make a check non-fatal with --ignore-preflight-errors=...To see the stack trace of this error execute with --v=5 or higher

If you dont have much CPUs to use then go ahead, you can have a cluster but you will face issues. Otherwise allocate 2 CPUs minimum on master node to work smoothly.

Thanks