Linux System Requirements for Kubernetes

Running a Kubernetes cluster can consume an incredible amount of system resources, depending on the size of your cluster, the services you are running, how many replicas are needed for scaling, and what kind of cluster you decide to launch (for example, kubeadm or minikube). Then again, a small cluster may consume next to no resources. Since there is so much variance in Kubernetes clusters, it can be hard to ascertain the system requirements for running one.

In this tutorial, we will give you some guidelines on system requirements for running Kubernetes on a Linux system. It is impossible to cover every scenario out there, but we can at least get you started with the basics and with understanding how system resources are consumed by Kubernetes. Let’s check out some of the most likely beginner scenarios below.

In this tutorial you will learn:

  • System requirements for kubeadm, minikube, and MicroK8s Kubernetes clusters
Linux System Requirements for Kubernetes
Linux System Requirements for Kubernetes
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Any Linux distro
Software Kubernetes, kubeadm, minikube, micro k8s
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user

Linux System Requirements for Kubernetes




We will go over a few different scenarios below to give you an idea about the minimum system requirements for various Kubernetes cluster setups.

kubeadm Minimum Requirements

The minimum requirements for running kubeadm are:

  • 2 GB of RAM per node
  • 2 CPU cores or more
  • Network connectivity between nodes (the master node must be able to talk to the workers)
  • A unique hostname and MAC address for every node (easy to accidentally overlook this when working with virtualized nodes)
  • Open ports for whichever services you plan on running (for example, HTTP port 80 for a web server cluster)
  • A containerization layer (Docker is the most popular choice for this)
  • The Linux machines must have their swap space disabled

These hardware specs should provide enough overhead for running kubeadm, while still leaving enough resources to run your deployed applications. Of course, if you plan on scaling a lot of replicas or hosting an assortment of different applications and services, then you will need to adjust your hardware accordingly.

DID YOU KNOW?
You should always monitor the CPU usage and RAM usage on the nodes to see if you need to dedicate more hardware resources to them. It is also possible to monitor the CPU and RAM usage on the pods in the cluser.

minikube Minimum Requirements




The requirements for minikube are about the same, but from experience, I can tell you that it is much more forgiving on system resources than kubeadm. Minikube is not a production ready bootstrapper, and is more ideal for testing or learning about Kubernetes. So, naturally, the system hardware does not need to be as robust.

The minimum requirements for running minikube are:

  • 2 GB of RAM
  • 2 CPU cores or more
  • 20 GB of free disk space
  • An internet connection (only necessary for initially getting minikube running)
  • A containerization layer (Docker is the most popular choice for this)

Minikube creates a single node cluster, so you do not need to worry about connectivity with other machines. You will only need to meet the system requirements on the main machine on which you plan to use minikube. Keep in mind, that once again, your hardware resources will need to scale along with the number of applications or replicas you plan on launching in minikube.

NOTE – Launching minikube
Here is a hint for controlling the CPU and RAM that you want to dedicate to minikube. When launching minikube from command line, use the --memory and --cpus options to control how many resources you want to let Kubernetes use. For example:

$ minikube start --driver=docker --memory 6000 --cpus=5

MicroK8s Minimum Requirements

MicroK8s is one of the lightest Kubernetes deployments available, with a very small footprint. This makes it ideal for deployment on edge devices or lightweight machines such as a Raspberry Pi or virtual machine. It can be used in a production environment at a very small scale, but is probably mostly known for its use in development and testing.

The minimum requirements for running MicroK8s are:

  • Ubuntu or another Linux distribution with access to the Snap package manager (this is the only way to install MicroK8s)
  • 540 MB of RAM (bare minimum)
  • An internet connection

While MicroK8s can technically run on the specs listed above, the recommended system requirements for running MicroK8s are:

  • 4 GB of RAM
  • 20 GB of free disk space

As is the case with any Kubernetes cluster, your hardware power must scale up along with the number of applications and replicas you plan on using inside MicroK8s.

Closing Thoughts




In this tutorial, we learned about the system requirements for running Kubernetes on a Linux system. Now that you know the hardware requirements for kubeadm, minikube, and MicroK8s, you can make a decision on which one your system will be able to handle. It should be common sense, but always remember that your hardware must be able to meet more robust requirements if you plan to launch a lot of applications or replicas within your Kubernetes cluster. Monitor your resource usage to make sure you have enough.



Comments and Discussions
Linux Forum