[Raspberry Pi] Installing K3S on Ubuntu within Raspberry Pi 4 Model (or B)
K3S on Raspberry Pi
K3S is the certified Kubernetes distribution built for IoT & Edge computing.
Raspberry Pi 4 Model (or B) is your tiny, dual-display, desktop computer …and robot brains, smart home hub, media centre, networked AI core, factory controller, and much more.
Why Use K3s
Perfect for Edge
K3s is a highly available, certified Kubernetes distribution designed for production workloads in unattended, resource-constrained, remote locations or inside IoT appliances.
Simplified & Secure
K3s is packaged as a single <40MB binary that reduces the dependencies and steps needed to install, run and auto-update a production Kubernetes cluster.
Optimized for ARM
Both ARM64 and ARMv7 are supported with binaries and multiarch images available for both. K3s works great from something as small as a Raspberry Pi to an AWS a1.4xlarge 32GiB server.
Prerequites
Raspberry Pi 4 Model
Raspberry Pi 4 Model (or B ) was released in June 2019[2] with a 1.5 GHz 64-bit quad core ARM Cortex-A72 processor, on-board 802.11ac Wi-Fi, Bluetooth 5, full gigabit Ethernet (throughput not limited), two USB 2.0 ports, two USB 3.0 ports, 2-8 GB of RAM, and dual-monitor support via a pair of micro HDMI (HDMI Type D) ports for up to 4K resolution.
Install Ubuntu on a Raspberry Pi
Running Ubuntu on your Raspberry Pi is easy. Just pick the OS image you want, flash it onto a microSD card, load it onto your Pi and away you go.
Install Ubuntu on a Raspberry Pi 2, 3 or 4 | Ubuntu - https://ubuntu.com/download/raspberry-pi
Installation
1 | curl -sfL https://get.k3s.io | sh - |
Advance
Manual start
1 | sudo k3s server |
Run on different node
1 | On a different node run the below. NODE_TOKEN comes from /var/lib/rancher/k3s/server/node-token |
Uninstall
To uninstall K3s from a server node, run:
1 | /usr/local/bin/k3s-uninstall.sh |
To uninstall K3s from an agent node, run:
1 | /usr/local/bin/k3s-agent-uninstall.sh |
FAQs
error: error loading config file “/etc/rancher/k3s/k3s.yaml”: open /etc/rancher/k3s/k3s.yaml: permission denied
1 | k3s kubectl get node |
Run command with sudo
1 | sudo k3s kubectl get node |
References
[1] K3s: Lightweight Kubernetes - https://k3s.io/
[2] Teach, Learn, and Make with Raspberry Pi - https://www.raspberrypi.org/
[3] Kubernetes - https://kubernetes.io/
[5] Install Ubuntu on a Raspberry Pi 2, 3 or 4 | Ubuntu - https://ubuntu.com/download/raspberry-pi