← Back to list

How to Install RKE2 Kubernetes Cluster (Beginner-Friendly Guide 2026)

🧠 Introduction

swadish · 2026-04-20 10:39 · 0 claps · 2.7 min read
#cloud-computing #rke2 #k8s #linode
Open on Medium ↗
Wiki topics: ☁️ · DevOps & Cloud

How to Install RKE2 Kubernetes Cluster (Beginner-Friendly Guide 2026)

🧠 Introduction

Kubernetes can feel overwhelming when you’re just starting out. Setting up a cluster, connecting nodes, and managing workloads isn’t straightforward at first.

In this guide, you’ll build a complete Kubernetes setup step by step using RKE2 and install Rancher on top of it.

By the end, you’ll have a working Kubernetes cluster with a UI you can access from your browser.

🏗️ Architecture

We will use four machines:

  • 3 Control Plane Nodes → manage the cluster
  • 1 Worker Node → runs applications

Linode VM

Linode VM

| Node     | Role          | IP            |
| -------- | ------------- | ------------- |
| cp-1     | Control Plane | 192.168.50.88 |
| cp-2     | Control Plane | 192.168.50.64 |
| cp-3     | Control Plane | 192.168.50.90 |
| worker-1 | Worker        | 192.168.50.86 |

⚙️ Step 1: Prepare All Nodes

Before installing Kubernetes, we need to prepare the system.

sudo apt update && sudo apt upgrade -y
sudo apt install -y curl wget gnupg2 software-properties-common

sudo timedatectl set-ntp true

sudo swapoff -a
sudo sed -i '/ swap / s/^/#/' /etc/fstab

sudo modprobe br_netfilter
sudo modprobe overlay

cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf
net.bridge.bridge-nf-call-iptables=1
net.ipv4.ip_forward=1
net.bridge.bridge-nf-call-ip6tables=1
EOF

sudo sysctl --system

👉 This step ensures your system is ready for Kubernetes networking.

⚙️ Step 2: Install RKE2

RKE2 is a lightweight Kubernetes distribution.

On Control Plane Nodes (cp-1, cp-2, cp-3)

curl -sfL https://get.rke2.io | sudo sh -
sudo systemctl enable rke2-server

On Worker Node (worker)

curl -sfL https://get.rke2.io | INSTALL_RKE2_TYPE=agent sudo sh -
sudo systemctl enable rke2-agent

⚙️ Step 3: Bootstrap First Control Plane

This node initializes the cluster on cp-1 .

cat <<EOF | sudo tee /etc/rancher/rke2/config.yaml
tls-san:
  - <ALL_CONTROL_PLANE_IPS>
  - <ALL_CONTROL_PLANE_IPS>
node-ip: <CURRENT_NODE_IP>
cluster-cidr: 10.42.0.0/16
service-cidr: 10.43.0.0/16
EOF
# Example values:
# <CONTROL_PLANE_1_IP> = 192.168.50.88
# <CONTROL_PLANE_2_IP> = 192.168.50.64
# <CONTROL_PLANE_3_IP> = 192.168.50.90
# <THIS_NODE_IP>       = current node IP
# <CLUSTER_CIDR>       = 10.42.0.0/16
# <SERVICE_CIDR>       = 10.43.0.0/16

Start the cluster:

sudo systemctl start rke2-server

Get the join token:

sudo cat /var/lib/rancher/rke2/server/node-token

⚙️ Step 4: Join Additional Control Planes

Run this on cp-2 and cp-3:

cat <<EOF | sudo tee /etc/rancher/rke2/config.yaml
server: <CP-1>:9345
token: <NODE_TOKEN>
node-ip: <NODE_IP>
tls-san:
  - <ALL_CONTROL_PLANE_IPS>
cluster-cidr: 10.42.0.0/16
service-cidr: 10.43.0.0/16
EOF
sudo systemctl start rke2-server

⚙️ Step 5: Join Worker Node

cat <<EOF | sudo tee /etc/rancher/rke2/config.yaml
server: <cp-1>:9345
token: <NODE_TOKEN>
node-ip: <worker-ip>
EOF
sudo systemctl start rke2-agent

🔍 Step 6: Verify the Cluster

Run on cp-1:

sudo ln -s /var/lib/rancher/rke2/bin/kubectl /usr/local/bin/kubectl
export KUBECONFIG=/etc/rancher/rke2/rke2.yaml

kubectl get nodes

You should see all nodes listed.

🚀 Step 7: Install Helm

Helm is used to install applications on Kubernetes.

curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

⚙️ Step 8: Install cert-manager

helm repo add jetstack https://charts.jetstack.io
helm repo update
helm install cert-manager jetstack/cert-manager \
  --namespace cert-manager \
  --create-namespace \
  --version v1.14.5 \
  --set installCRDs=true

Wait until ready:

kubectl -n cert-manager wait --for=condition=Ready pods --all --timeout=300s

🚀 Step 9: Install Rancher

helm repo add rancher-latest https://releases.rancher.com/server-charts/latest
helm repo update
helm install rancher rancher-latest/rancher \
  --namespace cattle-system \
  --create-namespace \
  --set hostname=rancher.yourdomain.com \
  --set replicas=3 \
  --set bootstrapPassword=admin

🌐 Step 10: Access Rancher

Add this to your Windows/linux hosts file:

<cp-1-ip> rancher.yourdomain.com

Open your browser:


메타데이터
post_id
a89f7d60cd00
slug
how-to-install-rancher-on-an-rke2-kubernetes-cluster-beginner-friendly-guide-2026-a89f7d60cd00
url
https://medium.com/@mswadish5/how-to-install-rancher-on-an-rke2-kubernetes-cluster-beginner-friendly-guide-2026-a89f7d60cd00
canonical_url
https://medium.com/@mswadish5/how-to-install-rancher-on-an-rke2-kubernetes-cluster-beginner-friendly-guide-2026-a89f7d60cd00
author_url
https://medium.com/@mswadish5
status
ok
fetched_at
2026-06-22 07:15:07