I knew I wanted to do the following:
- Learn more about Kubernetes without using work resources.
- Try some of the very neat open source projects that are mentioned on the Kubernetes podcast (ie, OpenFaas, MinIO, etc).
- Play around with some DIY home automation. I'm not completely sure what I want to do yet, but I have a bunch of Philips Hue lights that are begging to be controlled from the cluster.
Jeff's Kubernetes and Raspberry Pi videos are packed with useful information and he communicates very clearly. Definitely check them out!
I mostly followed his related blog post when I went to install K3s on my cluster. The K3s site has great information as well, and the install steps (all two of them) are very simple to follow.
Initial OS Selection and Setup
cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory
On First Boot
sudo PRUNE_MODULES=1 RPI_REBOOT=1 SKIP_WARNING=1 rpi-update
Before Installing K3s
sudo iptables -F sudo update-alternatives --set iptables /usr/sbin/iptables-legacy sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy sudo reboot
echo -e "10.0.1.1\twhite" | sudo tee -a /etc/hosts echo -e "10.0.1.2\tred" | sudo tee -a /etc/hosts echo -e "10.0.1.3\tgreen" | sudo tee -a /etc/hosts echo -e "10.0.1.4\tblue" | sudo tee -a /etc/hosts echo -e "10.0.1.5\tblack" | sudo tee -a /etc/hosts
curl -sfL https://get.k3s.io | K3S_KUBECONFIG_MODE="644" sh -s -
export TOKEN=`ssh -t pi@white sudo cat /var/lib/rancher/k3s/server/node-token` curl -sfL https://get.k3s.io | K3S_URL=https://10.0.1.1:6443 K3S_TOKEN=$TOKEN sh -
Test the Cluster
If you haven’t already installed kubectl, then install it now.
scp pi@white:/etc/rancher/k3s/k3s.yaml ~/.kube/config
Let's Run Something!
> echo -n "Hello" | curl --data-binary @- http://red:31111 _ _ _ _ | | | | ___| | | ___ | |_| |/ _ \ | |/ _ \ | _ | __/ | | (_) | |_| |_|\___|_|_|\___/