Lightweight Kubernetes on Raspberry Pi

  1. Set up the microSD card and install Raspbian Lite Image
  2. Configure SSH and WiFi
  3. Configure the Raspberry Pi
  4. Install K3S Server on the master
  5. Install K3S Agent on worker nodes
  6. Install the Kubernetes Dashboard for monitoring the cluster

Hardware Components needed

  1. Raspberry Pi x 3
  2. 16 GB microSD card x 3
  3. Raspberry compatible power supply x 3

Softwares needed

curl -sfL | sh -
sudo systemctl status k3s
export K3S_URL="https://k3smaster:6443" export K3S_TOKEN="<<replace with your token>>"
curl -sfL | sh -
kubectl get nodes rpimaster Ready master 33h v1.17.4+k3s1 
rpinode2 Ready <none> 28h v1.17.4+k3s1
rpinode1 Ready <none> 29h v1.17.4+k3s1
kubectl apply -f
cat <<EOF | kubectl apply -f -
apiVersion: v1
kind: ServiceAccount
name: admin-user
namespace: kubernetes-dashboard
kind: ClusterRoleBinding
name: admin-user
kind: ClusterRole
name: cluster-admin
- kind: ServiceAccount
name: admin-user
namespace: kubernetes-dashboard
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk '{print $1}')
kubectl proxy --port=8081



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