All-in-one Portable Raspberry Pi K3s Cluster
by jackalito in Circuits > Computers
350 Views, 4 Favorites, 0 Comments
All-in-one Portable Raspberry Pi K3s Cluster
When I first saw Raspberry Pi kubernetes clusters, I always knew I wanted to try one one day, even if on a small scale. When I went into this project I wanted a kubernetes cluster that had a router to give the pis their own IP addresses so this could be taken between networks, have removable spots for the pis, power supply and cooling built in, and fit in a portable form factor. For what software I wanted to run I originally wanted to so a home surveillance system with an IP camera, but there were some hiccups with that.
Supplies
- Raspberry Pi
- 3mm acrylic
- TPLink TL-R605
- Anker USB charing station
- Noctua NF-F12 5V fan
- USB power cables for your pis of choice
- some ethernet patch cables
- acrylic adhesive
- some M2 screws about 6-10 cm in length
Build the Case
Laser cut the DXF files including whatever cards are necessary for the pis you're using depending on if you want ethernet ports on the top or bottom.
Use acrylic adhesive to glue all the box wall plates together.
Put the fan in right after.
I used hot glue to put the card supporting plates in to I would not seal the fan in forever to the acrylic glue.
Get the Pis In
Using M2 screws, screw the Rapberry Pis to their plates with the spacer model to be 3D printed for each mounting hole for the pis.
Don't put the pis in just yet, follow the headless prep in the nest step, then when you put the SD card in you can.
Networking the Pis
Follow the headless prep from this video: https://youtu.be/X9fSMGkjtug?t=713
Connect your computer and type the IP address of the router into your browser top search bar.
Just to make sure the IP addresses are working, plug in each pi one at a time and check their IP addresses at they show up in the LAN section of the router settings.
Ssh and Install Software
Once you can find the pis on their static IPs, ssh in and update and install any software packages you may want.
Install k3s on the master with this command:
curl -sfL https://get.k3s.io | sh -
And when that is up and running tun this command on each node.
Remember to replace K3S_URL and K3S_TOKEN, which you canfigure out how to get in the previously linked guide during his installation.
curl -sfL https://get.k3s.io | K3S_URL=https://serverip:6443 K3S_TOKEN=mytoken sh -
To see what nodes are connected and running are, use
kubectl get nodes
At this point you can installsoftware to be used in your kubernetes cluster! To see how I installed the Grafana dashboard, follow this guide: https://youtu.be/IafVCHkJbtI