Kubernetes Raspberry pi(no Microk8s, k3s)

sudo apt update && sudo apt upgrade
sudo apt update && sudo apt install -y kubelet kubeadm kubectl
echo ‘overlay
br_netfilter’ | sudo tee -a /etc/modules-load.d/containerd.conf
sudo modprobe overlay
sudo modprobe br_netfilter
echo ‘net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
net.bridge.bridge-nf-call-ip6tables = 1’ | sudo tee -a /etc/sysctl.d/99-kubernetes-cri.conf
sudo sysctl — system
# Install containerd
## Set up the repository
### Install packages to allow apt to use a repository over HTTPS
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
### Add Docker’s official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
### Add Docker apt repository.
sudo add-apt-repository \
"deb https://download.docker.com/linux/ubuntu \
focal \
stable"## Install containerd
sudo apt-get update
sudo apt-get install containerd.io
# Configure containerd
sudo containerd config default | sudo tee /etc/containerd/config.toml
# Restart containerd
sudo systemctl restart containerd
sudo nano /etc/crictl.yaml
runtime-endpoint: unix:///run/containerd/containerd.sock
sudo nano /etc/systemd/system/kubelet.service.d/10-kubeadm.conf
Environment=”KUBELET_EXTRA_ARGS= — cgroup-driver=systemd — container-runtime=remote — runtime-request-timeout=15m — container-runtime-endpoint=unix:///run/containerd/containerd.sock”
sudo systemctl daemon-reload
sudo systemctl restart kubelet.service
kubectl apply -f “https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d ‘\n’)
sudo kubeadm config images pull
sudo kubeadm init — cri-socket /run/containerd/containerd.sock
sudo kubeadm join 192.168.184.186:6443 — token o92btx.6lkh97nb3m7f7 — discovery-token-ca-cert-hash sha256:1dee61cf705803f6284573a987e82654e639b3948b6cab7ffdb793b762

--

--

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