Linux

How to Set Up a Kubernetes Homelab with K3s on Ubuntu: Lightweight Cluster for Learning and Dev

The Back Room Tech Staff · Edited by Aseem Kishore
22 min read

The Back Room Tech is reader-supported. We may earn a commission when you buy through links on our site. Learn more.

This guide builds a real multi-node Kubernetes cluster on Ubuntu with K3s, from bare machines to a working server plus agents. You’ll pin a version, set firewall rules that don’t break cluster traffic, get kubectl access from your laptop, and learn the clean teardown. You get real scheduling, real nodes, and real kubectl. You skip the cloud bill and the ceremony of kubeadm.

The short answer: Run the official get.k3s.io install script on one Ubuntu machine to create the server. Read the join token from /var/lib/rancher/k3s/server/node-token. Then run the same script on each worker with K3S_URL and K3S_TOKEN set. Pin the release with INSTALL_K3S_VERSION or INSTALL_K3S_CHANNEL. If UFW stays on, open TCP 6443, your Flannel port, and the pod/service CIDRs. Remove everything later with k3s-uninstall.sh or k3s-agent-uninstall.sh.

How to Set Up a K3s Kubernetes Homelab on Ubuntu: Quick Reference

TaskCommand or FileRun On
Install server (control plane)sudo sh ./k3s-install.shServer
Pin a release lineINSTALL_K3S_CHANNEL=stableServer and agents
Pin an exact versionINSTALL_K3S_VERSION=vX.Y.Z+k3s1Server and agents
Get join token/var/lib/rancher/k3s/server/node-tokenServer
Join a workerK3S_URL=https://SERVER_IP:6443 plus K3S_TOKEN=...Agent
Kubeconfig for remote kubectl/etc/rancher/k3s/k3s.yaml, then edit server:Server, then copy to laptop
Core ports6443/tcp, 8472/udp (VXLAN) or 51820/udp (WireGuard IPv4; add 51821/udp for IPv6)All nodes
Remove a serversudo /usr/local/bin/k3s-uninstall.shServer
Remove an agentsudo /usr/local/bin/k3s-agent-uninstall.shAgent

Ports above cover the single-server-plus-agents setup this guide builds; metrics-server, HA, and embedded-registry configurations need additional ports (see Step 2).

What Is K3s?

K3s is a certified, lightweight Kubernetes distribution. It packs Kubernetes into a single binary managed by systemd. The pieces most homelabs need come bundled: containerd as the container runtime, Flannel for pod networking, CoreDNS, Traefik as the ingress controller, ServiceLB as a basic load balancer, and local-path-provisioner for storage.

It also bundles kubectl, crictl, and ctr as subcommands (run them as k3s kubectl, k3s crictl, and k3s ctr), plus helper scripts like k3s-killall.sh and the uninstall scripts. Bundled defaults can change between releases, so check the K3s docs for your version.

The design uses a server (control plane) and agents (workers). The server can store cluster state in an embedded datastore, which is typically SQLite for a single-server setup. You don’t need to run a separate etcd cluster for this kind of setup.

Check the K3s installation docs for the exact default datastore in your version. That’s the main reason K3s is easier to live with than kubeadm in a homelab.

The catch is that K3s makes opinionated choices for you. Want to learn how to wire up a CNI plugin, a container runtime, and etcd by hand? kubeadm teaches more. Want to learn Kubernetes workloads (Deployments, Services, Ingress, Helm)? K3s gets you there in minutes. MicroK8s and k0s are similar lightweight options with different packaging and defaults.

Scope note: This guide covers one server plus one or more agents. High-availability setups with multiple servers and embedded etcd are out of scope. This guide is Linux-only, since that’s the platform K3s documents installing on; your laptop on any OS can still run kubectl against the cluster.

Prerequisites

Sources below were retrieved November 2, 2026. Requirements come from the K3s installation requirements page.

  • Two or more Ubuntu machines. This guide targets Ubuntu 24.04 LTS; check the Ubuntu release cycle page for its current support window before you commit. Ubuntu 26.04 LTS is the current LTS (release list). If you’re building fresh, either LTS works for this guide: the K3s commands are the same on both. Check the K3s requirements page for the operating systems it currently tests.
  • Supported CPU architecture: x86_64, arm64/aarch64, or armhf. Old laptops, a mini PC, or a Raspberry Pi can qualify if they also meet the hardware minimums below and run a supported Ubuntu release.
  • Server node minimum: Check the current CPU and RAM minimums on the K3s requirements page; budget extra beyond that floor for your workloads.
  • Agent node minimum: Check the current CPU and RAM minimums on the K3s requirements page; budget extra beyond that floor for your workloads.
  • A unique hostname on every node, or a unique K3S_NODE_NAME set at install time.
  • Network reachability between nodes on TCP 6443, your Flannel backend port (UDP 8472 for VXLAN, or UDP 51820 for WireGuard — add 51821 if IPv6 is used), and TCP 10250 if your workloads use the metrics-server.
  • SSH access with a user that has sudo rights on every node.
  • curl installed (it ships with Ubuntu Server by default).
  • Static IPs or DHCP reservations for each node. If the server’s IP changes, agents and your kubeconfig break.
  • kubectl on your laptop if you want remote access (optional, covered in Step 9).

Those minimums are the floor. Plan on more RAM if you’ll run real apps. Put the server on an SSD, not an SD card or spinning disk. The datastore writes regularly, and slow storage can show up as a sluggish API and flaky nodes. Wired networking is worth it too: in a homelab, a basic gigabit switch and Cat6 cable usually mean fewer dropped-node surprises than Wi-Fi.

Official K3s installation requirements page showing the server and agent CPU/RAM minimums table and the inbound networking ports section

Example Environment

RoleHostnameIP Address
Serverk3s-server-01192.168.1.50
Agentk3s-agent-01192.168.1.51
Agentk3s-agent-02192.168.1.52

Swap in your own hostnames and IPs throughout.

Step-by-Step Guide

Step 1: Give Every Node a Unique Hostname

K3s uses the hostname as the node’s identity. Cloned VMs and fresh Raspberry Pi images often share a default hostname. Two nodes with the same name will fight over one identity, so fix this before you install anything.

On the server:

sudo hostnamectl set-hostname k3s-server-01

On each agent, use its own name:

sudo hostnamectl set-hostname k3s-agent-01

Check it:

hostnamectl --static

Expected output:

k3s-server-01

Then confirm each agent can reach the server:

ping -c 3 192.168.1.50

You should see three replies with 0% packet loss.

Tip: If you can’t change the hostname (say, it’s managed elsewhere), set K3S_NODE_NAME=your-unique-name alongside the other install variables in Steps 4 and 7.

Step 2: Decide How to Handle UFW

The K3s requirements page recommends turning off UFW on cluster nodes. On an isolated homelab VLAN, that’s the simplest path:

sudo ufw disable

Expected output:

Firewall stopped and disabled on system startup

If policy or habit says UFW stays on, open these instead. Run them on every node:

# Allow SSH first so enabling UFW doesn't lock you out
sudo ufw allow OpenSSH

# Kubernetes API server: agents and your laptop connect here
sudo ufw allow 6443/tcp

# Flannel VXLAN backend: node-to-node pod traffic
sudo ufw allow 8472/udp

# Pod CIDR (default 10.42.0.0/16)
sudo ufw allow from 10.42.0.0/16 to any

# Service CIDR (default 10.43.0.0/16)
sudo ufw allow from 10.43.0.0/16 to any

If you switch Flannel to the WireGuard backend, open its port instead of 8472/udp:

# Flannel WireGuard backend port (IPv4)
sudo ufw allow 51820/udp

Add 51821/udp as well if IPv6 is in use with the WireGuard backend, including dual-stack setups; an IPv4-only homelab doesn’t need it.

# Flannel WireGuard backend port, needed when IPv6 is used
sudo ufw allow 51821/udp

If you’ll rely on the metrics-server for kubectl top or horizontal pod autoscaling, also open the kubelet port between nodes so it can be scraped:

# Kubelet port, needed node-to-node if you use metrics-server
sudo ufw allow 10250/tcp

To limit the API port to your LAN, swap the plain 6443/tcp rule for a source rule like this one:

# Only accept API traffic from the 192.168.1.0/24 subnet
sudo ufw allow from 192.168.1.0/24 to any port 6443 proto tcp

Enable UFW and review the rules:

sudo ufw enable
sudo ufw status numbered

You should see Status: active and a numbered list with each rule above.

Warning: If you’re connected over SSH, run sudo ufw allow OpenSSH before sudo ufw enable. Skip it and you’ll lose your session. You’ll need a console, KVM, or a monitor and keyboard to get back in.

The K3s docs recommend turning the host firewall off if you can; the rules above mirror their documented minimum for keeping it on (API port plus the pod and service CIDRs). The pod and service CIDR rules are the part a lot of guides skip. Allowing only 6443 lets agents join, but without rules for pod and service traffic, pods on different nodes often can’t talk to each other.

Check the K3s requirements page for the authoritative list of ports and ranges for your version, including the ones this guide doesn’t cover, such as HA and the embedded registry. These rules cover a typical single-backend homelab; your Flannel backend, metrics-server use, and any firewall between the nodes can call for more. Symptoms of missing rules include DNS timeouts and stuck pods, which are harder to trace later.

Step 3: Download and Inspect the Install Script

The K3s quick-start shows a one-liner that pipes the script from https://get.k3s.io straight into sh. That works. Saving it first lets you read what you’re about to run as root, though. It also gives you one file to reuse on every node.

# -s silent, -f fail on HTTP errors, -L follow redirects, -o write to a file
curl -sfL https://get.k3s.io -o ~/k3s-install.sh

Skim it:

less ~/k3s-install.sh

Press q to quit. Copy this file to each agent too, or run the same curl command on each one.

Official K3s quick-start page showing the get.k3s.io install command and the reference to the kubeconfig file at /etc/rancher/k3s/k3s.yaml

Step 4: Install the Server Node with a Pinned Version

Two environment variables control which release you get, as documented on the K3s installation page; confirm current behavior there since semantics can shift between releases:

VariableWhat It DoesWhen to Use It
INSTALL_K3S_CHANNELInstalls the newest release from a channel such as stable or latestYou want “current stable” but stated on purpose
INSTALL_K3S_VERSIONInstalls one exact version and overrides the channelYou want every node, and every rebuild, identical

If you set neither, the script picks a release from its default channel. The docs describe that default as stable. Check the installation page for your release before you rely on it.

For a homelab you’ll rebuild, pin an exact version. Look up the current version string on the K3s release blog or the GitHub releases rather than relying on a cached example. Version strings are typically formatted like vX.Y.Z+k3s1; confirm the exact current release string before you install.

On the server only, install with an exact version:

# Replace vX.Y.Z+k3s1 with the real release string you looked up
INSTALL_K3S_VERSION=vX.Y.Z+k3s1 sh ~/k3s-install.sh

Run the script as your regular user, without sudo in front, as the K3s docs do. The script calls sudo itself when it needs root, and the INSTALL_K3S_* and K3S_* variables you set on the command line go straight to the script.

Or pin to the stable channel:

INSTALL_K3S_CHANNEL=stable sh ~/k3s-install.sh

Optional: skip the bundled Traefik ingress if you plan to run your own controller. Extra arguments pass through to the K3s server:

# --disable=traefik skips the bundled Traefik ingress controller
INSTALL_K3S_VERSION=vX.Y.Z+k3s1 sh ~/k3s-install.sh --disable=traefik

The script prints a run of [INFO] lines. It downloads the binary, creates the k3s systemd service, and starts it. How long it takes depends on your bandwidth and hardware.

Note: Because K3S_URL isn’t set here, the script sets this machine up as a server. That variable is the switch between server and agent installs.

Step 5: Verify the Server Is Running

Check the systemd service:

sudo systemctl status k3s --no-pager

Look for this line:

     Active: active (running)

Now check the node. K3s bundles kubectl, so you can use it right away:

sudo k3s kubectl get nodes

Expected output (your age and version will differ):

NAME            STATUS   ROLES           AGE   VERSION
k3s-server-01   Ready    control-plane   45s   vX.Y.Z+k3s1

The exact labels in the ROLES column can vary by release, but you should see a control-plane role. If STATUS says NotReady, give it another 30 seconds. The node waits for networking and CoreDNS to come up first.

Check the system pods:

sudo k3s kubectl get pods -n kube-system

You should see CoreDNS, local-path-provisioner, metrics-server (bundled by default), and (unless you disabled it) Traefik pods move to Running or Completed.

Step 6: Grab the Node Token

Agents need a shared secret to join. K3s writes it on the server here:

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

The output is one long string. Copy the whole thing. In the next step you’ll paste it as YOUR_NODE_TOKEN.

Warning: Treat this token like a root password. Anyone with it and network access to port 6443 can join a machine to your cluster. Don’t commit it to Git or paste it in chat.

Step 7: Join the Agent Nodes

On each agent, run the same script with two extra variables:

  • K3S_URL points at the server’s API. Setting it tells the script to install an agent instead of a server.
  • K3S_TOKEN is the token from Step 6.

Use the same version you pinned on the server:

# K3S_URL: server API address; K3S_TOKEN: value from node-token on the server
K3S_URL=https://192.168.1.50:6443 \
  K3S_TOKEN='YOUR_NODE_TOKEN' \
  INSTALL_K3S_VERSION=vX.Y.Z+k3s1 \
  sh ~/k3s-install.sh

The single quotes around the token stop the shell from reading any special characters in it.

Check the agent service. On agents it’s named k3s-agent, not k3s:

sudo systemctl status k3s-agent --no-pager

Expected:

     Active: active (running)

Repeat on every agent.

Tip: Upgrade server nodes before agents, and follow the Kubernetes version-skew policy for the gap you allow between them. Keep every node on the release you intend for the cluster, and don’t skip over unsupported minor-version jumps when you move between pinned versions.

Step 8: Confirm Cluster Membership

Back on the server:

# -o wide adds internal IP, OS image, kernel, and container runtime columns
sudo k3s kubectl get nodes -o wide

Expected output (trimmed):

NAME            STATUS   ROLES           AGE   VERSION       INTERNAL-IP
k3s-server-01   Ready    control-plane   12m   vX.Y.Z+k3s1   192.168.1.50
k3s-agent-01    Ready    <none>          2m    vX.Y.Z+k3s1   192.168.1.51
k3s-agent-02    Ready    <none>          1m    vX.Y.Z+k3s1   192.168.1.52

Agents show <none> under ROLES. That’s normal; they’re plain workers.

Output of sudo k3s kubectl get nodes -o wide on k3s-server-01 listing the server and two agents, with the STATUS column showing Ready for all three and the ROLES column showing control-plane for the server and none for the agents

Run a quick smoke test to prove pods schedule on workers:

sudo k3s kubectl create deployment hello --image=nginx --replicas=3
sudo k3s kubectl get pods -o wide

After a few seconds the three hello-... pods should be Running. The NODE column shows where each one landed. The scheduler will often spread them across nodes, but a plain Deployment doesn’t guarantee it; use topology spread constraints or pod anti-affinity when placement matters. Clean up:

sudo k3s kubectl delete deployment hello

Step 9: Use kubectl from Your Laptop

SSHing into the server for every command gets old. The server’s admin kubeconfig lives at /etc/rancher/k3s/k3s.yaml. It’s owned by root, so make a copy you can pull over scp.

On the server:

# Copy the root-owned kubeconfig to your home dir and take ownership
sudo cp /etc/rancher/k3s/k3s.yaml ~/k3s.yaml
sudo chown "$USER":"$USER" ~/k3s.yaml

On your laptop (Linux or macOS shell shown), with kubectl installed per the Kubernetes docs:

mkdir -p ~/.kube
scp [email protected]:~/k3s.yaml ~/.kube/k3s-homelab.yaml
chmod 600 ~/.kube/k3s-homelab.yaml

The generated kubeconfig normally points at https://127.0.0.1:6443 (check its server: line). From any other machine, that address points back at the machine itself, not the server. Change it to the server’s real IP:

# Rewrite the server address from localhost to the server's LAN IP
sed -i 's#https://127.0.0.1:6443#https://192.168.1.50:6443#' ~/.kube/k3s-homelab.yaml

On macOS, BSD sed needs an empty backup suffix: sed -i '' 's#https://127.0.0.1:6443#https://192.168.1.50:6443#' ~/.kube/k3s-homelab.yaml.

Confirm the change:

grep server: ~/.kube/k3s-homelab.yaml

Expected:

    server: https://192.168.1.50:6443

Point kubectl at it and test:

export KUBECONFIG=~/.kube/k3s-homelab.yaml
kubectl get nodes

You should see the same three Ready nodes from Step 8. Add the export line to ~/.bashrc or ~/.zshrc to make it stick.

Delete the temporary copy on the server:

rm ~/k3s.yaml

Warning: This file has full admin rights to the cluster. Keep it at chmod 600 and off shared drives.

Step 10: Tear Down a Node (or the Whole Cluster)

The install script drops uninstall scripts in /usr/local/bin. Use the one that matches the node’s role.

Warning: These scripts stop K3s, remove its binaries and systemd units, and delete its data. On a server, the cluster state is gone, along with every workload, Secret, and the node token. There’s no undo. Back up anything you care about first. The scripts only clean up the node itself: router DHCP reservations, the UFW rules you added, and anything outside the cluster stay in place until you remove them.

To remove a whole cluster, do the agents first. On each agent:

sudo /usr/local/bin/k3s-agent-uninstall.sh

Then on the server:

sudo /usr/local/bin/k3s-uninstall.sh

Check that it’s gone:

systemctl status k3s --no-pager

Expected:

Unit k3s.service could not be found.

To remove just one agent from a running cluster, drain and delete it from the server first. That way workloads move cleanly:

# Evict pods from the node; DaemonSet pods are skipped because they run everywhere
sudo k3s kubectl drain k3s-agent-02 --ignore-daemonsets --delete-emptydir-data
sudo k3s kubectl delete node k3s-agent-02

Then run k3s-agent-uninstall.sh on that agent.

Want to stop K3s for a while without removing it? sudo /usr/local/bin/k3s-killall.sh stops the service and its containers.

Configuration

Key Install Variables and Flags

SettingDefaultSet OnPurpose
INSTALL_K3S_CHANNELInstaller’s default channel (documented as stable)All nodesChoose a release line like stable or latest
INSTALL_K3S_VERSIONUnsetAll nodesPin one exact version; overrides the channel
K3S_URLUnsetAgents onlyServer API URL; presence makes the node an agent
K3S_TOKENUnsetAgents onlyJoin secret from /var/lib/rancher/k3s/server/node-token
K3S_NODE_NAMEMachine hostnameAny nodeOverride the node name if hostnames collide
--disable=traefikTraefik enabledServerSkip the bundled ingress controller

Key Files and Paths

PathNodeWhat It Is
/etc/rancher/k3s/k3s.yamlServerAdmin kubeconfig
/var/lib/rancher/k3s/server/node-tokenServerAgent join token
/usr/local/bin/k3s-uninstall.shServerServer teardown script
/usr/local/bin/k3s-agent-uninstall.shAgentAgent teardown script
/usr/local/bin/k3s-killall.shBothStop K3s and its containers

Firewall Ports by Role

Port / RangeProtocolNeeded When
6443TCPAlways: agents and kubectl reach the API server
8472UDPFlannel VXLAN backend
51820UDPFlannel WireGuard backend (IPv4)
51821UDPFlannel WireGuard backend, when IPv6 is used
10250TCPNode-to-node, needed if you use the metrics-server
10.42.0.0/16AnyDefault pod CIDR, if UFW is on
10.43.0.0/16AnyDefault service CIDR, if UFW is on

HA control planes and the embedded container registry need further ports of their own; both are out of scope for the single-server setup this guide builds. Check the requirements page for the current list if you add either later.

Upgrading a Pinned Cluster

To upgrade, re-run the install script with a newer INSTALL_K3S_VERSION, repeating every argument and environment variable you used the first time, including flags like --disable=traefik. Before you start, check the running service’s command line so you know exactly what to repeat:

sudo systemctl cat k3s --no-pager

Look for the ExecStart line and copy its flags into your upgrade command. Upgrade the server first, then each agent, following the Kubernetes version-skew policy for the versions involved and avoiding unsupported minor-version jumps:

# 1. On the server first — keep any flags from the original install, e.g. --disable=traefik
INSTALL_K3S_VERSION=vNEW.VERSION+k3s1 sh ~/k3s-install.sh --disable=traefik
# 2. Then on each agent, same version
K3S_URL=https://192.168.1.50:6443 \
  K3S_TOKEN='YOUR_NODE_TOKEN' \
  INSTALL_K3S_VERSION=vNEW.VERSION+k3s1 \
  sh ~/k3s-install.sh

Warning: Back up the server’s datastore before upgrading it. On the default single-server setup that’s the SQLite data under /var/lib/rancher/k3s/server/db; with embedded etcd, take a snapshot with sudo k3s etcd-snapshot save; with an external datastore, use that database’s own backup. Datastore corruption during an upgrade is rare but unrecoverable without a backup.

After each server upgrade, confirm the node is healthy before moving on to the next one:

sudo k3s kubectl get nodes
sudo systemctl status k3s --no-pager

Re-download k3s-install.sh before upgrading so you have the current script. Read the release notes on the K3s blog and the applicable version-skew guidance before jumping a minor version. If the server hosts anything you’d hate to lose, put it on a UPS. A power cut mid-upgrade on a single server makes for a bad afternoon.

Tips and Troubleshooting

Agent Won’t Join the Cluster

Why it happens: A mistyped K3S_TOKEN, a wrong K3S_URL, or UFW blocking 6443 on the server.

Fix:

  • Re-copy the token from /var/lib/rancher/k3s/server/node-token. Paste it in single quotes.
  • From the agent, test the API port:
curl -k https://192.168.1.50:6443

Any response, even an Unauthorized JSON error, means the port is open. A timeout or Connection refused means a network or firewall problem.

  • On the server, check sudo ufw status for the 6443/tcp rule.
  • Read the agent’s logs:
sudo journalctl -u k3s-agent -n 50 --no-pager

Nodes Show NotReady or Pods Stay Pending

Why it happens: Flannel’s overlay port is blocked between nodes. Or a node is below the resource floor documented on the K3s requirements page for its role (server or agent).

Fix:

  • Open 8472/udp (VXLAN) or 51820/udp (WireGuard IPv4 — add 51821/udp if IPv6 is used) on every node. If you use the metrics-server, also confirm 10250/tcp is reachable between nodes.
  • Check the node’s conditions:
sudo k3s kubectl describe node k3s-agent-01

Look under Conditions for MemoryPressure, DiskPressure, or PIDPressure set to True. Also check Events at the bottom.

UFW Blocks Cluster Traffic Even After Allowing 6443

Why it happens: Port 6443 covers the API only. Pod-to-pod and pod-to-service traffic uses the pod CIDR (10.42.0.0/16) and service CIDR (10.43.0.0/16). Typical symptoms are CoreDNS timeouts and apps that can’t reach each other across nodes.

Fix: Add the CIDR rules from Step 2 on every node, and check the K3s requirements page for the current port list for your version. Or disable UFW on the cluster nodes, as the K3s requirements page recommends.

Duplicate Hostname or Node Identity Conflicts

Why it happens: Cloned VMs or stock images share a hostname.

Fix: Uninstall K3s on the duplicate with k3s-agent-uninstall.sh. Run sudo hostnamectl set-hostname your-unique-name. Then reinstall, or pass K3S_NODE_NAME=your-unique-name to the install script.

kubectl on Your Laptop Can’t Reach the Cluster

Why it happens: The kubeconfig still points at https://127.0.0.1:6443.

Fix: Run grep server: ~/.kube/k3s-homelab.yaml. If it shows 127.0.0.1, repeat the sed command from Step 9 with the server’s IP. Confirm KUBECONFIG is set with echo $KUBECONFIG.

Agent Won’t Join After a Server Upgrade

Why it happens: The agent ended up newer than the server, or the version jump between them skipped a minor release that the Kubernetes version-skew policy doesn’t support.

Fix: Upgrade the server first to the target version, then bring agents to a version that satisfies the version-skew policy relative to the server; avoid skipping intermediate minor releases.

You Don’t Want the Bundled Traefik

Why it happens: Traefik is on by default.

Fix: Reinstall the server with --disable=traefik as shown in Step 4, then deploy the ingress controller you prefer.

Quick Tips

  • Keep one copy of the install script. The same downloaded k3s-install.sh plus a pinned version on every node means fewer surprises.
  • Record your version string. Note it in your homelab docs next to the node IPs. Rebuilds become copy-paste.
  • Use sudo k3s kubectl on the server. K3s bundles kubectl as a subcommand, so you don’t need a separate install there.
  • Reserve IPs in your router. A server IP that moves breaks every agent and your laptop’s kubeconfig at once.

Wrapping Up

You now have a multi-node K3s cluster on Ubuntu with a pinned version. The firewall passes both API and pod traffic, kubectl works from your laptop, and teardown takes one command per node. Next, deploy an app behind the bundled Traefik ingress, or install Helm and work through a chart or two.

My take: for learning Kubernetes workloads, K3s is the right default for a homelab. You give up some of the “build it from parts” lessons kubeadm teaches. In return, you get a cluster that fits on a pair of mini PCs and rebuilds in minutes. That makes it a good place to break things on purpose.

StepActionApplies To
1Set unique hostnamesAll nodes
2Disable UFW or open portsAll nodes
3Download install scriptAll nodes
4–5Install and verify server with pinned versionServer
6Read node tokenServer
7Join agents with K3S_URL and K3S_TOKENAgents
8Confirm nodes are ReadyServer
9Copy and edit kubeconfigServer, laptop
10Uninstall scriptsAgents, then server

Resources