About this project

Flannel is a straightforward and efficient network fabric solution primarily designed for Kubernetes environments, though it also supports Docker deployments. Its core function is to establish a Layer 3 IPv4 network between multiple nodes within a cluster, ensuring that each container (pod) has a unique, routable IP address. This model simplifies networking by eliminating the complexities associated with sharing host IPs. ### Core Architecture Flannel operates via a lightweight binary agent called `flanneld`, which runs on every host in the cluster. The agent is responsible for allocating a specific subnet lease to each host from a larger, preconfigured address space. To maintain state and configuration, Flannel utilizes either the Kubernetes API directly (known as the kube subnet manager) or an external etcd cluster. This flexibility allows it to store network configurations, allocated subnets, and auxiliary data such as host public IPs. ### Backend Mechanisms Packet forwarding between hosts is handled through various backend mechanisms. These include VXLAN for overlay networks and specific integrations tailored for different cloud providers. Users can select the backend that best fits their infrastructure requirements. ### Network Policy Support While Flannel focuses on connectivity rather than policy enforcement, it offers options for integrating network policies: - **Integrated Controller:** The Flannel Helm chart includes an option to deploy the Kubernetes SIGs network policy controller alongside Flannel. - **Third-party Controllers:** Users can pair Flannel with other projects like Calico or Cilium for advanced policy enforcement, potentially using CNI chaining. ### Deployment Options For Kubernetes clusters, Flannel can be deployed manually or via package managers: - **kubectl:** Users can apply the official manifest directly using `kubectl apply`. - **Helm:** A dedicated Helm repository allows for easy installation and configuration management. It is recommended to use the manifests attached to specific releases to ensure compatibility. Additionally, deploying Flannel requires the `br_netfilter` kernel module and the installation of CNI network plugins in `/opt/cni/bin`. For non-Kubernetes environments, such as standalone Docker setups, Flannel always relies on etcd as its datastore. Documentation provides detailed guidance for these scenarios. ### Community and Licensing Flannel is an open-source project licensed under Apache 2.0. It maintains an active community with regular maintainer meetings, Slack channels for support (#k3s on Rancher Slack, #flannel-users on Calico Slack), and comprehensive documentation covering building, configuration, troubleshooting, and integrations.