🕸️Networking
The network spans two physical sites (folly and offsite) joined by a UniFi Site Magic tunnel, with Cloudflare in front of anything public and Tailscale for remote access.
Single source of truth
All cluster network facts — node/API IPs, pod CIDRs, BGP ASNs and peer addresses, DNS — live in per-cluster
cluster-topologyConfigMaps atclusters/<site>/config/cluster-topology.json. Flux substitutes them, Nix parses them, Terraformjsondecodes them. Do not hardcode network facts anywhere else. Details in ADR/0003 Cluster topology single source of truth.Not yet migrated: the FRR
*.confBGP files andterraform/network/tailscale/policy.hujsonstill hold literals.
On-site fabric (UniFi)
terraform/network/unifi/folly/manages VLANs, BGP, and clients at the primary site;terraform/network/unifi/offsite/manages the offsite network. Read-only live discovery is available via theunifi-networkskill.
Load balancing (Cilium BGP)
Cilium advertises LoadBalancer VIPs (pools in
clusters/<site>/networking/cilium/ip-pools.yaml) and pod CIDRs to the site gateway over BGP — ADR/0005 Cilium BGP load balancing.
Cross-site reachability
folly ⇄ offsite k8s traffic rides the single Site Magic tunnel. iBGP between the gateways carries the routes, but the gateway firewall is the actual gate: a gateway only forwards the pod CIDRs and VIP pools if its firewall allows the full k8s address space, not just node subnets.
folly enforces this with a custom
Labzone interraform/network/unifi/folly/firewall.tf; offsite uses the permissive defaultInternalzone.
Ingress and tunnels
The Gateway API
cluster-gatewayhandles in-cluster ingress; Cloudflare Tunnels (terraform/network/cloudflare/) are the external entry points — one per site (folly,offsite, e.g. Atlantis attf.lolwtf.carides the offsite tunnel).external-dns publishes records; DNS zones (pulsifer.ca, wishin.app, lolwtf.ca) are Terraform-managed.
Remote access
Tailscale (
terraform/network/tailscale/) provides the overlay: devices, routes, and the ACL policy. k8s nodes have Tailscale disabled (tailscale-disable.nix); the Pis and edge hosts run it.LAN hosts resolve as
<host>.lolwtf.ca; reaching offsite from off-net requires the tailnet.
Linked references 4
Architecture/Networking, ADR/0003 Cluster topology single source of truth, terraform/network/unifi/folly/README.md
Cilium is the CNI and the BGP load balancer; VIP pools live in networking/cilium/ip-pools.yaml — see Architecture/Networking and ADR/0005 Cilium BGP load balancing.
Architecture/Networking — VLANs, BGP, Cilium load balancing, tunnels, and the cross-site fabric