Installation series — Article 2
Installing Kubernetes Rancher K3S
One Command installation
In my last article of this installation series, we installed MicroK8s from Canonical, which was fast installation and almost one line of command. In this article, we are going to install the K3S distribution from Rancher; K3S is a Kubernetes distribution created by Rancher Labs. It has a small binary size and can be highly available and production ready. Installing K3S is a super fast way to get up and running.
As usual, I’m using an Ubuntu 23.04 machine; let's first update our OS:
sudo apt update
sudo apt upgrade
Install curl — if not installed:
sudo apt install -y curl
install k3s:
curl -sfL https://get.k3s.io | sh -
That's it; we have installed Rancher …
Now we can check the status of the cluster:
sudo systemctl restart k3s
sudo systemctl status k3s
Now to configure kubectl to be able to run all its commands, we need to copy the configuration of K3S to the default location, which kubectl will check for it.
sudo cat /etc/rancher/k3s/k3s.yaml > ~/.kube/config
Now we can check the status of the installation and running PODs:
Kubectl get pods --all-namespaces
As we can see from the kube-system namespace, multiple controllers and PODS come active by default.
Summary
In this article, we saw how it is fast and easy to get ready with a single node Rancher k3s Kubernetes cluster; K3S is a lightweight Kubernetes with small binaries and can be used to a small test environment or even for the production-ready high available cluster, in future articles we will use the high availability feature of K3S and further explore its capabilities.