Installing a Kubernetes Cluster Overview
You can install Kubernetes on premises or in the Cloud. Each environment offers several choices described in the following sections. The installation process varies depending on the selected option.
When setting up an on-premises cluster, you can choose from several popular Kubernetes distributions—such as RKE2, K3s, MicroK8s, and OpenShift—or deploy the official upstream Kubernetes using kubeadm.
We recommend using K3s, a lightweight and fully certified Kubernetes distribution that is easy to install and requires significantly fewer resources than a standard Kubernetes setup. Learn more
Before installing the K3s cluster, you need to decide on the number of nodes and their roles. K3s has two types of nodes serving the following roles:
-
Server nodes (masters)—used as the control plane and etcd data store. By default, they also run workloads.
-
Agent nodes (workers)—dedicated to running workloads.
Plan your setup along the following recommendations:
-
Set up either 1 or 3 server nodes. Avoid using an even number of server nodes to prevent a split-brain scenario.
-
Add the desired number of agents to spread the workload effectively.
-
For small clusters (2 to 6 nodes), run workloads on the server node(s) as well.
System Requirements and Recommendations
-
Hardware:
-
Server nodes (control plane + the etcd database): 2 CPUs, 2 GB RAM minimum; 4+ CPUs and 8+ GB RAM recommended.
-
Agent nodes (workers): 1 CPU, 512 MB RAM minimum; 2+ CPUs and 4+ GB RAM recommended.
-
SSD disks (strongly recommended, especially for server nodes, since etcd is write-intensive).
-
-
Operating System:
-
64-bit Linux (Ubuntu, CentOS, Rocky Linux, Debian, or other).
-
Swap must be disabled:
sudo swapoff -a
-
-
Networking & Ports:
-
Ports accessible from outside the cluster:
-
TCP 443 for HTTPS access to WebHMI (via MetalLB + HAProxy). This is the main port that end users need to reach.
-
TCP 80 for HTTP access to WebHMI. Optional; typically redirects to HTTPS).
-
TCP 22 for SSH access. Optional; needed for remote command-line access to nodes.
-
TCP 8443 for the Rancher UI. Must be reachable from the administrators’ machines. Required only when using Rancher.
-
-
Inter-node ports (between Kubernetes nodes):
-
TCP 6443 for the Kubernetes API server. Agents connect to server nodes on this port.
-
UDP 8472 for Flannel VXLAN overlay network. Required on all nodes.
-
TCP 10250 for Kubelet API. Required between all nodes.
-
TCP 2379–2380 for etcd peer communication. Server nodes only; required only in HA setups with multiple server nodes.
-
-
When using Rancher, the machine running the Rancher container must have network connectivity to all Kubernetes nodes in both directions.
-
There are two main ways to install K3s:
-
Direct installation (the official method)
Installing K3s directly from the official project, which minimizes overhead, and then deploying and managing the cluster via the command line. It is ideal for small clusters or resource-constrained environments. Learn more
-
Installation via Rancher
Using Rancher, a complete container management platform for Kubernetes, to deploy and manage one or more K3s clusters. Rancher provides a powerful web UI, centralized management, and multi-cluster support. However, it requires some CPU and memory overhead. Learn more
If you are unsure which installation is better for your purposes, start with the direct installation. You can always deploy Rancher later and import your existing K3s cluster.
The installation process depends on the cloud provider.
When running Kubernetes in the cloud, you have two main options:
-
Self-managed clusters, installed and managed manually on cloud-based virtual machines.
The installation process is the same as for an on-premises Kubernetes setup. You simply provide Linux virtual machines and connect to them via the Secure Shell (SSH) protocol. From there, you can install K3s or any other Kubernetes distribution just as you would on an on-premises cluster. However, this approach has several disadvantages: you are responsible for managing the control plane, handling upgrades, performing backups, and scaling the cluster.
-
Managed Kubernetes services, provided and maintained by cloud vendors, such as the following:
-
Azure Kubernetes Service (AKS) – Managed Kubernetes from Microsoft Azure.
-
Amazon Elastic Kubernetes Service (EKS) – Managed Kubernetes from Amazon Web Services.
-
Google Kubernetes Engine (GKE) – Managed Kubernetes from Google Cloud.
-
Most major cloud providers offer a fully managed Kubernetes service that automates much of the work. These services handle the control plane and integrate tightly with the provider’s networking, security, and monitoring systems. A managed Kubernetes cluster offers several key advantages:
-
No need to manually install or maintain the control plane.
-
Automatic updates, patching, and scaling.
-
Easy integration with cloud services such as load balancers, storage, and identity management.
-
High availability and reliability out of the box.
Because of these benefits, managed Kubernetes clusters are the preferred choice for most users. The installation is typically straightforward and can be performed in several ways:
-
Command-line interface (CLI): using tools such as az, aws, or gcloud.
-
Web console: installing through the provider’s management portal.
-
Infrastructure as code: using tools like Terraform for automated and repeatable deployments.
What's Next?