Setting Up Lightweight On-Premise Kubernetes Cluster (K3s)

avinash gawadeavinash gawade
2 min read

What is K3s?

K3s is a lightweight, certified Kubernetes distribution designed for resource-constrained environments, edge computing, and IoT use cases. It is easy to install, minimal in resource consumption, and fully compliant with the Kubernetes API.

Key Highlights of K3s:

  • Single binary distribution – Delivered as a single <40 MB binary or minimal container image, simplifying installation and upgrades.

  • Lightweight datastore – Uses SQLite3 as the default storage backend, reducing complexity. It also supports etcd3, MySQL, and PostgreSQL for more advanced or HA setups.

  • Simplified control plane – All core Kubernetes control plane components are encapsulated into a single binary and process. K3s automates complex operations such as certificate distribution and cluster management.

  • Minimal requirements – Only a modern Linux kernel and cgroup mounts are required to run, making it highly portable.

K3s lowers the barrier to entry for Kubernetes by offering a lightweight yet powerful option for edge deployments, development environments, and production workloads where full Kubernetes may be too heavy.

In this tutorial we gone see how we can deploy 2 node k3s with cillum CNI

Step 1: Installation of K3s on Master Node

$ curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server" sh -s - --flannel-backend none --token 12345

Here I disable Flannel Because Flannel is default CNI Plugin in K3s so we gone use cilium as CNI Plugin Coz cilium provide as Visiblity over microservices thanks to Hubbel, It Provide us Layer 7 and Layer 4 level Network Policy and service mesh Feature which is lack in Flannel.

Step 2: Installation of Cilium CNI

2.1 Using Below Command Cilium CLI

CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable.txt) CLI_ARCH=amd64 if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum} sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}

2.2 Install Cilium:

cilium install --version 1.18.1

2.3 Verify the Installation

cilium status

Step 3: Install K3s on Worker Node

curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="agent" sh -s - \

--server https://masternodeIP:6443 \

--token 12345

Install Cilium CLI using same command as 2.1

using cilium status You can check status and using kubectl get nodes You can see 1 Master Node and 2 node as Worker node

Enjoy Kubing!!

0
Subscribe to my newsletter

Read articles from avinash gawade directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

avinash gawade
avinash gawade