This repo manages a Raspberry Pi K3s (Kubernetes) cluster.
k3s: https://k3s.io/
- Setup Raspberry Pis with Raspbian (Can try other OS's, but I tested this with Raspbian Buster)
- Setup SSH (preferably passwordless with ssh key)
- Setup host names for driver and worker nodes. I used
raspberry-driver
as the driver node hostname (which is referenced in the Makefile.)
- Ansible
- Terraform (tfenv supported via the
.terraform-version
file.) - Lens IDE (Recommended for general K8s Management, not needed to run through this repo)
Once nodes are setup as specified above and SSH connection is setup, proceedd with using Ansible and Terraform for setup:
- Add node hostnames or IPs to
inventory/hosts.ini
- If needed, edit
inventory/group_vars/all.yml
to match your environment (such as SSH username). - Run
make install
(runs through the ansible playbook) - Run
make kubeconfig
(copies the kubeconfig from the driver node to~/.kube/config-pi
)- This config location is the default for the Terraform configs.
- Run
terraform init
- Run
terraform apply
- K8s Ingresses for LAN connection
- SealedSecrets
- Local Docker Registry (To host local custom Dockerfiles)