Flannel is a layer 3 network fabric designed for Kubernetes that provides overlay networking between hosts. It runs a flanneld agent on each node to allocate subnet leases from a preconfigured address space using either Kubernetes API or etcd for storage. Traffic is forwarded via pluggable backend mechanisms including VXLAN, UDP, IPsec, host-gw, WireGuard, and cloud-specific integrations like Tencent VPC. The architecture separates concerns into backend management, subnet allocation, traffic management (iptables/nftables), and routing, with a plugin system enabling extensibility. Key entry points include the main daemon (main.go), backend registration system, subnet watchers, and traffic manager interfaces. The system handles IP address allocation, encapsulation, decapsulation, and traffic masquerading to enable pod-to-pod communication across nodes in a cluster.
This repository provides documentation and automation scripts for setting up a Kubernetes cluster from scratch using VirtualBox. It includes shell scripts for creating and configuring VM images with cloud-init, configuration files for various Kubernetes components (etcd, control plane, worker nodes, HAProxy load balancers), and detailed documentation explaining the setup process. The repository serves as an educational guide for understanding Kubernetes infrastructure components and how they interact, rather than a deployable application itself. The main value lies in the well-structured automation scripts and comprehensive documentation that walk users through building a complete Kubernetes cluster with high availability features.