intro
Task setup Raspberry Pi 4 with Kubernetes so I can test out Service Mesh.
Cast around for a guide that worked well for me, found this from Vladimir Cicovic.
Reproduced steps here for my reference, added anything specific to my use case.
main()
Setup control plane and worker nodes
apt update
apt upgrade
hostnamectl set-hostname k8s-master-skynet
hostnamectl set-hostname k8s-worker-01
hostnamectl set-hostname k8s-worker-02
sudo -i
cat <<EOF>> /etc/hosts
192.168.150.100 k8s-master-skynet
192.168.150.101 node-1 k8s-worker-01
192.168.150.102 node-2 k8s-worker-02
EOF
modprobe br_netfilter
modprobe overlay
cat << EOF | tee /etc/modules-load.d/k8s-modules.conf
br_netfilter
overlay
EOF
cat << EOF | tee /etc/sysctl.d/k8s.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
EOF
sysctl --system
apt-get update ; apt-get install -y containerd
mkdir -p /etc/containerd
containerd config default | tee /etc/containerd/config.toml
sed -i "s/SystemdCgroup = false/SystemdCgroup = true/g" /etc/containerd/config.toml
systemctl restart containerd
swapoff -a
apt-get install -y apt-transport-https curl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add
apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
apt install -y kubeadm kubelet kubectl
Worker nodes to save some time later
kubeadm config images pull
Control Plane
kubeadm init --pod-network-cidr=192.168.0.0/16
# As non-root user
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config
Worker Node
sysctl net.ipv4.ip_forward=1
kubeadm join 192.168.150.100:6443 --token xxx \
--discovery-token-ca-cert-hash sha256:xxx
kubectl
scp ubuntu@192.168.150.100:/home/ubuntu/.kube/config .
kubectl get nodes
nameserver
/etc/systemd/resolved.conf
DNS=8.8.8.8
Istio Service Mesh
./bin/istioctl install
This will install the Istio 1.15.2 default profile with ["Istio core" "Istiod" "Ingress gateways"] components into the cluster. Proceed? (y/N) y
✔ Istio core installed
✔ Istiod installed
✔ Ingress gateways installed
✔ Installation complete Making this installation the default for injection and validation.
Thank you for installing Istio 1.15. Please take a few minutes to tell us about your install/upgrade experience! https://forms.gle/SWHFBmwJspusK1hv6
outro
sources
Kubernetes setup on Ubuntu 22.04 LTS (Jammy Jellyfish) - Vladimir Cicovic