Installing k3s on Raspberry Pi 4

I was looking to have a cluster for learning more Kubernetes but minikube was just not cutting it and full fledged k8s was too heavy for a Pi setup.
Enter k3s. Its a much lighter version of k8s without compromising on the API features. Its very ideal for bringing up a cluster quickly on devices starved of resources.
It comes as a single binary and uses SQLite as a database instead of etcd.
I was able to get the control plane up in less than a minute. Its using Docker for container runtime. I’ve disabled Traefik ingress controller as well.

root@pi-four1:~/k3s# curl -SsL https://get.k3s.io/ > install.sh
root@pi-four1:~/k3s# export INSTALL_K3S_EXEC=” — disable=traefik — docker”
root@pi-four1:~/k3s# bash install.sh
.
.
[INFO] systemd: Starting k3s

root@pi-four1:~/k3s# k get no
NAME STATUS ROLES AGE VERSION
pi-four1 Ready control-plane,master 107s v1.20.5+k3s1

K3s comes with local path provisioner storage class for persistent storage.

root@pi-four1:~/k3s# k get sc
NAME PROVISIONER RECLAIMPOLICY VOLUMEBINDINGMODE ALLOWVOLUMEEXPANSION AGE
local-path (default) rancher.io/local-path Delete WaitForFirstConsumer false 8m32s

By default, this was mapped to somewhere in /var/lib. I have a USB drive and this will be used for persistent storage. Modified the local path provisioner configmap with the correct mount path.

root@pi-four1:~/k3s# lsblk | grep usb
└─sda1 8:1 0 232.9G 0 part /mnt-usb

root@pi-four1:~/k3s# k edit cm local-path-config -nkube-system
configmap/local-path-config edited

--

--

--

I work with cloud, containers, linux

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

New Hardware Configuration for Decision Optimization

Deploying An Existing Application Using Okteto Cloud

Functional programming is red ink

Why Java is the best Programming language for Beginners to Learn Coding?

Why Java is the best Programming language for Beginners to Learn Coding?

Lenovo ThinkPad X1 Carbon 14" G6 6th Gen Intel Core i7–8650U 16GB 512GB SSD QHD

Lenovo ThinkPad X1 Carbon 14

How to run your DevOps using Docker containers

Swift Leetcode Series : Longest Valid Parentheses

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Adithya

Adithya

I work with cloud, containers, linux

More from Medium

Windows Terminal + Cygwin

brave_2022-01-05_13-21-05.png (710×744)

The Unix File System Explained

Server Hardening with OpenSCAP

content of /usr/share/xml/scap/ssg/content/ directory

Why is Linux considered the best of all?🤔