How the lab's network is laid out
Purpose
This post maps the lab’s network. It is a UniFi-managed LAN with a separate segment for the k3s cluster, Traefik as the HTTP(S) entry point, a Cloudflare tunnel for a few public apps and Tailscale for the offsite backup box. It also covers how the cluster moved onto its own segment, and what one bad uplink looked like from inside the cluster.
Deployment
Layout at a glance:
flowchart LR
NET["Internet"]
CF["Cloudflare tunnel<br/>(cloudflared pod)"]
TS["Tailscale pod"]
OFF["Offsite backup box"]
subgraph LAN["LAN"]
GW["UniFi Cloud Gateway Max"]
SW["UniFi switches"]
PVE["Two Proxmox hosts"]
NAS["TrueNAS"]
subgraph SEG["Cluster segment"]
K3S["k3s nodes (4)"]
TRF["Traefik and MetalLB pool<br/>(LoadBalancer services)"]
end
end
NET --> CF
CF --> K3S
OFF --> TS
TS --> K3S
GW --> SW
SW --> PVE
SW --> NAS
PVE --> K3S
K3S --> TRF
The gateway is a UniFi Cloud Gateway Max. The switches are UniFi too: a USW Pro XG 10 PoE aggregation switch, a USW Enterprise 8 PoE and a USW Flex 2.5G uplinked into the XG 10.
The cluster has 4 nodes (3 workers and 1 control-plane/etcd node), all Debian 13 running k3s v1.34.12, all on the dedicated cluster segment. The nodes are Proxmox LXC containers on one Proxmox host, and all 4 report the Proxmox kernel. They used to be Pi boards: the three CM4 nodes sat on the Enterprise 8 and the two CM5 boards on the Flex 2.5G. All five were retired in October 2026.
The two Proxmox hosts each have a 10 GbE SFP+ link to the same UniFi switch, so guests on either host reach each other at 10 GbE (about 9.4 Gbit/s measured). That holds inside one segment. Traffic between the LAN and the cluster segment is routed by the gateway, so it goes over the switch’s uplink to the gateway and not switch-local at 10 GbE.
Configuration
MetalLB runs in layer-2 mode with one address pool, one L2 advertisement and a speaker pod on each of the 4 nodes. The pool is a small contiguous block on the cluster segment. The rest of the segment is kept for static infrastructure addresses and DHCP. See the MetalLB post.
10 Services are of type LoadBalancer: nine in the default namespace (ActiveMQ, git-ollama-tools, Kafka, Mailpit, Mosquitto, NiFi, Postgres, RustFS, SFTPGo) and the Traefik entry point in the traefik namespace. The ones in default are the non-HTTP services that need a stable address.
kube-vip provides the Kubernetes API address as a floating virtual IP. A kube-vip DaemonSet pod runs in kube-system.
Traefik routes HTTP(S) into the cluster. The IngressRoute listing is 33 lines long, header included, across all namespaces. TLS uses a wildcard certificate issued by cert-manager and copied per namespace. See the Traefik post and the cert-manager post.
Split DNS works through the UniFi gateway’s local DNS. Asking the gateway’s resolver for a public app name returns a CNAME to the local Traefik name and a LAN address, while a public resolver returns Cloudflare’s addresses for the same name. A wildcard covers the internal prod names.
A single cloudflared Deployment on cloudflare/cloudflared:2026.11.1 carries the Cloudflare tunnel for the few public apps. See the Cloudflare post.
Tailscale runs in the cluster as a single pod in the tailscale namespace on image tailscale/tailscale:v1.104.4, in userspace mode, with its state kept in a Kubernetes Secret. See the Tailscale post.
Storage
There is no network-attached storage setup to describe here beyond the offsite box. The offsite pi-nas pulls backups over the LAN today. Before it leaves the LAN it needs a Tailscale path (a subnet route or the Tailscale app on TrueNAS) and the pull gate’s from= updated to its tailnet address. TrueNAS has no Tailscale itself. The write-up is in the offsite ZFS pull post.
Access
Inside the LAN, public app names resolve to the local Traefik through the gateway’s DNS. From outside, the same names resolve to Cloudflare and reach the cluster through the tunnel. The offsite box will use Tailscale once it leaves the LAN.
Notes
The cluster moved onto its own segment in phases:
- DHCP reservations for the nodes.
- A cross-subnet pod network test, which passed with ping both ways, DNS, ClusterIP, LoadBalancer and kubelet checks.
- The MetalLB pool.
- A renumber window for the nodes and the API address. The nodes restarted onto the new segment while the switch port’s native VLAN was changed.
The plan kept each node’s last address octet, which made every change mechanical. One snag: the new segment’s DHCP range overlapped the static infrastructure hosts. The fix was to shrink the DHCP range and keep the lower block for static addresses.
The bad uplink showed up as DNS lookups from pods on the CM5 nodes (Raspberry Pi nodes at the time, retired in October 2026) stalling for 2 to 5 seconds. The loss traced to a single physical uplink, the Flex 2.5G into the XG 10. It showed 0.71 % rx errors (7,489,727 of 1,056,262,812 packets) and had negotiated 1 Gbit instead of 2.5 Gbit. Traffic that stayed on one side of that uplink had 0 % loss. CoreDNS ran as a single replica then, so at the time every lookup from the CM5 nodes crossed the bad link.
The investigation ruled out CoreDNS itself, the conntrack race and the VXLAN/host stack, so the cause was the cable or port and not software. The issue was closed on 2026-10-19, and CoreDNS now runs 2 replicas in kube-system.