Welcome to my homelab Kubernetes cluster repository! This project serves as both a personal learning journey and a resource for others interested in setting up their own Kubernetes Homelabs. The setup consists of 2 Raspberry Pi 4s and a Mac Mini, showcasing how you can build a powerful, heterogeneous cluster with hardware you might already have at home.
- 2 x Raspberry Pi 4 (4GB and 8GB models)
- 1 x Mac Mini
- Network switch (with 3 Gigabit Ethernet cables)
- Nest Wifi router
- Power supplies for each device
- 32 GB microSD cards for the Raspberry Pis
This combination of ARM (Raspberry Pi) and x86 (Mac Mini) architectures demonstrates the flexibility of Kubernetes in managing diverse hardware! The Raspberry Pis are great for edge computing and IoT projects, while the Mac Mini provides additional compute power and storage.
-
MicroK8s: Our choice of Kubernetes distribution
- Why: MicroK8s is lightweight, easy to install, and perfect for edge computing and IoT devices like Raspberry Pis. It's also backed by Canonical, ensuring good support and documentation.
-
Talos OS (In trial phase)
- Why: I am currently exploring Talos OS as a potential replacement for the current Ubuntu/MicroK8s setup. Talos is a minimal, immutable Linux distribution designed specifically for running Kubernetes, which can enhance security and simplify upgrades.
- ArgoCD: GitOps continuous delivery tool
- Why: ArgoCD allows us to define our entire cluster state in Git, making it easier to manage, version, and rollback changes. It's a powerful tool for maintaining consistency between our Git repositories and live cluster state.
- Istio: Service mesh
- Why: Istio provides the traffic management, security, and observability features for the cluster's microservices. In a learning environment, it's invaluable for understanding modern microservices architectures and practices.
-
PostgreSQL: Relational database
- Why: PostgreSQL is a robust, open-source database that's widely used in production environments. It's an excellent choice for learning about database management in Kubernetes.
-
Redis: In-memory data structure store
- Why: Redis is often used for caching and real-time applications. Including it in our stack allows us to explore performance optimization techniques and distributed caching, as well as session storage and pub/sub messaging.
- RabbitMQ: Message broker
- Why: RabbitMQ is a popular choice for implementing message queues and pub/sub systems. It's great for learning about decoupled architectures and asynchronous communication between services.
- OpenFaaS: Serverless functions platform
-
SOPS: Secrets encryption
- Why: SOPS allows us to securely store encrypted secrets in our Git repository, which is crucial for maintaining security in a GitOps workflow.
-
Reflector: Kubernetes resource reflection
- Why: Reflector helps us manage secrets across namespaces, which is particularly useful in a learning environment where we might want to share certain configurations across different parts of our cluster.
apps/
: Application-specific configurationsargocd/
: ArgoCD setup and configurationdomains/
: Domain-specific configurationshack/
: Utility scriptsistio/
: Istio service mesh configurationopenfaas/
: OpenFaaS serverless platform setuppostgres/
: PostgreSQL database configurationrabbitmq/
: RabbitMQ message broker setupredis/
: Redis in-memory data store configurationreflector/
: Reflector configuration for secret managementtalos/
: Talos OS configuration and setup scripts (for our ongoing trial)
- Install MicroK8s on your Raspberry Pis and Mac Mini following the official guide.
- Join the nodes to form a cluster using
microk8s add-node
command. - Apply the configurations in the
argocd/
directory to set up ArgoCD. - Use ArgoCD to deploy the rest of the applications and configurations.
For detailed setup instructions, please refer to the README files in each directory.
This homelab setup provides numerous learning opportunities:
- Multi-architecture clusters: Learn how to manage a cluster with both ARM and x86 nodes.
- GitOps: Understand how to manage your entire infrastructure as code using ArgoCD.
- Service Mesh: Explore advanced networking concepts with Istio.
- Databases in Kubernetes: Learn how to run and manage databases in a containerized environment.
- Serverless on Kubernetes: Experiment with serverless architectures using OpenFaaS.
- Message Queues: Understand asynchronous communication patterns with RabbitMQ.
- Caching: Learn about distributed caching and performance optimization with Redis.
- Security: Explore secure secret management practices with SOPS and Reflector.
Contributions, questions, and discussions are welcome! Feel free to open issues or submit pull requests if you have suggestions or improvements.
This project is licensed under the Apache License 2.0. See the LICENSE file for details.