flannel is a network fabric for containers, designed for Kubernetes
open sourceApache-2.0self-hostablefree
Flannel is a simple layer 3 network fabric for Kubernetes: a small agent, flanneld, on each host leases that host a subnet from a cluster-wide range and forwards pod traffic between hosts with VXLAN (recommended), host-gw routing, WireGuard or UDP for debugging, storing its state in the Kubernetes API or etcd. It's the default CNI in K3s and RKE2, supports Windows worker nodes, and also networks containers outside Kubernetes. It doesn't enforce network policies by itself: its Helm chart can add the Kubernetes SIGs network policy controller, or Calico can provide policy on top (Canal). It's Apache-2.0.
Ways to install
On Kubernetes
Problems it solves
- the simplest way to give pods on different Kubernetes nodes IP addresses that can reach each other
- pick a lightweight CNI plugin for a small or edge Kubernetes cluster
- pod networking for a kubeadm cluster with almost no configuration
- an overlay network between hosts that works on any cloud without touching its routing tables
- faster pod networking with plain routes when all our nodes share one layer 2 network
- encrypt pod traffic between nodes with WireGuard using the same CNI
- networking that supports Windows worker nodes in our Kubernetes cluster
- allocate each host its own container subnet and route between them for Docker containers outside Kubernetes
- add network policy enforcement to a cluster whose pod network is flannel
Features
- flanneld agent on each host allocates a subnet lease from a preconfigured range
- Kubernetes API (kube subnet manager) or etcd as the datastore
- backends: VXLAN, host-gw, WireGuard and UDP; experimental IPIP, IPsec, Alloc and TencentCloud VPC
- VXLAN DirectRouting uses plain routes between hosts on the same subnet
- IPv6 and dual-stack options
- Windows support for VXLAN
- CNI plugin for Kubernetes and guidance for Docker outside Kubernetes
- kubectl manifest attached to each release and a Helm chart with an optional network policy controller
Limitations
Alternatives
The same job
These do what Flannel does.
