What I wanted to achieve:
- Using 4 of my Raspis for Kubernetes: Part 1
- Learn how to deploy a Spring Boot application: Part 2
- Expose this application to the internet: Part 3
Part 1: Setting up the cluster
For my setup I use 1 Raspi 4 and 3 Raspi 3B. The Raspi 4 serves as master node, the others as client nodes. First I flashed HypriotOS on all 4 Raspis. Before commencing don’t forget to:
sudo apt-get update && sudo apt-get upgrade
I recommend to install flannel on all Raspis:
sudo apt-get install flannel
Edit /boot/cmdline.txt and add this: cgroup_enable=memory, do a reboot.
I use K3S, which is a somewhat ’lightweight’ distribution suitable for Raspis. The installation has been made quite easy with k3sup. Follow the instructions there. It should be no hassle.
The token which will be needed to add other Raspis as nodes to the cluster can be found on the master under
/var/lib/rancher/k3s/server/node-token. Copy it and execute on other nodes:
curl -sfL https://get.k3s.io | K3S_URL=https://master:6443 K3S_TOKEN=mastertoken sh -
With sudo journalctl -f executed on the node the join process with master should be visible.