How vhgalvez/flatcarmicrocloud works
Main Components
• Physical Infrastructure:
• ProLiant DL380 G7 server with dedicated specs (CPU, RAM, storage)
• KVM hypervisor with Libvirt/KVM networking support.
• Virtualization and Network Layers:
• Virtual networks defined by Terraform (br0_network, nat_network_02, nat_network_03)
• pfSense VMs for firewall/NAT and routing.
• WireGuard VPN for secure remote access.
• Kubernetes Cluster:
• Control Plane (“Master” nodes running on Flatcar Container Linux with K3s and etcd)
• Worker nodes executing microservices/apps.
• Dedicated VMs for roles like FreeIPA (DNS and central authentication), PostgreSQL (database), and storage nodes.
• Load Balancing & Ingress:
• Load Balancer nodes (Traefik based) and HAProxy + Keepalived for high availability (k8s-api-lb VIP).
• Automation and Provisioning:
• Terraform modules and scripts to set up networks and VMs.
• Ansible playbooks for configuring FreeIPA, NTP, HAProxy/Keepalived, K3s, Ingress (Traefik), and storage clusters.
• External Interfaces:
• Cloudflare CDN, external HTTPS access, and monitoring/CI pipelines.
Relationships and Interactions
• External Clients (users, public Internet) connect via HTTPS (with the help of Cloudflare and VPN gateways).
• Ingress flows via the WireGuard VPN and pfSense firewall before reaching the load balancers.
• Load Balancers (Traefik and HAProxy+Keepalived) route requests to the Kubernetes control plane (Master nodes).
• Within the Kubernetes cluster:
• Master nodes manage the API, etcd, and cluster state.
• Worker nodes run containerized services with supporting microservices (Apache Kafka, MQTT, Redis, etc.).
• Persistent storage is configured via NFS/Longhorn on designated VMs.
• FreeIPA provides DNS and authentication services, with PostgreSQL running on its own VM supporting microservice data needs.
• Automation tools (Terraform, Ansible) have “control flows”—they provision and then configure these various components, ensuring consistency across the infrastructure.
Architectural Patterns and Design Principles
• Infrastructure as Code (Terraform manifests per network and VM).
• Ansible-based automated configuration deployments ensuring repeatability.
• Kubernetes High Availability:
• Multiple masters and workers with an external load balancing layer.
• Network segmentation with NAT and Bridge (isolating different environments and roles).
• Separation of concerns through dedicated VMs for DNS (FreeIPA), databases (PostgreSQL), load balancing, and storage.
• Use of both light and secure container OS (Flatcar Container Linux) for minimal attack surface.
Relevant Technologies, Frameworks, and Tools
• Operating Systems: Rocky Linux 9.5, AlmaLinux 9.4, Flatcar Container Linux.
• Virtualization: KVM, Libvirt.
• Orchestration: Kubernetes (K3s) with etcd-managed masters.
• Network Management: Terraform for networking, pfSense, WireGuard, iptables/nftables.
• Load Balancing: Traefik, HAProxy, Keepalived.
• Automation: Ansible.
• Monitoring & Logging: Prometheus, Grafana, ELK stack.
• Additional Tools: Apache Kafka, MQTT Mosquitto, Redis, Jenkins/GitHub Actions for CI/CD.
• Physical infrastructure with its network interfaces.
• Virtualized networks (each NAT network as its own submodule).
• Kubernetes cluster (control plane and worker nodes, persistent storage).
• External services (Cloudflare, VPN, external monitoring).
• The goal is to avoid oversimplification by splitting the project into as many well-defined components as possible.