How ricsanfre/pi-cluster works
Main Components
• Hardware/Physical Layer:
– Raspberry Pi devices (ARM nodes) and refurbished x86 mini PCs that host the Kubernetes nodes.
– A separate firewall/router component (possibly running OpenWRT on a Raspberry Pi) to isolate the cluster.
• OS Provisioning and Bootstrapping:
– Cloud‑init configuration files (in the “metal” folder and in cloud‑init sub-directories) that prepare the nodes.
– PXE boot arrangements for x86 nodes.
• Configuration Management & Automation:
– Ansible playbooks and roles (located in the “ansible” and “ansible-runner” folders) that automate OS configuration, software installation, initial setup (DNS, certificates, etc.), and the deployment of Kubernetes (K3s) itself.
• GitOps and Kubernetes Application Management:
– FluxCD integration (with the Kubernetes manifests in the “kubernetes” folder and FluxCD templates) that applies helm charts and kustomizations to the cluster.
– The “kubernetes” folder organizes different clusters’ configurations, manifests for applications (e.g., cert-manager, keycloak, minio, longhorn, and others) for internal and external services.
• External Services and Integrations:
– External DNS, certificate management (Let’s Encrypt via Cert-Manager/Certbot), secrets management (Vault and External Secrets), and backup solutions (Velero/Restic).
– Additionally, legacy or externally hosted services (like a VM running Minio backup).
Relationships and Interactions
• “provisioning/bootstrapping” flow from the hardware to the node OS setup (cloud‑init, PXE).
– Cluster OS configuration,
– K3s installation, and
– External service configurations.
• How FluxCD is used as the GitOps engine that pulls manifests (from the “kubernetes” folders) and applies them to the K3s cluster.
• Direct interactions between cluster services (e.g., traffic flow from ingress controllers (NGINX vs. HAProxy) to services deployed on Kubernetes, integration with external DNS services, certificate authorities, and cloud backup providers).
Design Patterns and Architectural Principles
• Infrastructure as Code and GitOps methodology.
• Separation of concerns—distinct layers for hardware provisioning, configuration management (Ansible), and application deployment (FluxCD/Kubernetes manifests).
• Hybrid nature of the cluster (ARM and x86 nodes) and how network isolation is enforced by a dedicated firewall.
Relevant Technologies and Frameworks
• Cloud‑init, Ansible, K3s Kubernetes, FluxCD.
• Additional stack components: container runtime (containerd), CNI (Cilium), DNS (CoreDNS and ExternalDNS), load balancing (HAProxy, Ingress NGINX), storage (Longhorn, Minio), certificate management (Cert-Manager, Let’s Encrypt), secrets management (Vault, External Secrets), monitoring (Prometheus, Grafana, Loki, Fluentd/Fluent Bit, Tempo), service mesh (Istio), IAM (Keycloak, OAuth2 Proxy) and streaming/Kafka components.