On this page
An application runs in a Kubernetes cluster, and people outside the cluster have to reach it. Not all of them the same way: one client may read the whole site, another a few pages, and a third nothing at all. If you come from networking, the pieces look familiar. There are routers and BGP underneath, an address that some device answers ARP for, and an access list on top. The surprise is where they meet. The access list names clients by their source address, and whether that address is still on the packet when the list is applied depends on which node answered ARP.
This post is the new write-up of a subject this blog has covered before, in Kubernetes Meets the Data Center: Cilium BGP, FRR Leaf-Spine Fabric, and Role-Based L3/L7 Policy Enforcement. It runs the same story again on another lab, with Cilium 1.20, and says what holds there and what turned out differently.
It is also the written deep dive for a lesson of the series Kubernetes Networking for Network Engineers on the LevelUP I.T. YouTube channel. The cluster is Kubernetes 1.35.8, built with kubeadm and without kube-proxy, on four virtual machines in two racks, kernel 6.8. Its network plugin is Cilium 1.20.5 in native routing: each node has a BGP session to its rack's router, masquerading is off, and Envoy runs as a DaemonSet of its own. The routers run FRRouting 10.5.4. The outputs below are the lesson's recording. The variants the video leaves out are marked as coming from an earlier run on this lab, with the values measured then. Pod addresses, identities, endpoint numbers, the proxy's port, the Cilium pods' names and source ports change at each build, so read those from the outputs.
What you'll find here
- What changed since the first write-up, point by point.
- The fabric as the cluster sees it: the three kinds of BGP object, the sessions, and what the routers learned.
- Three LoadBalancer Services with addresses from a pool, the layer 2 announcement policy, the lease and its holder.
- A
CiliumNetworkPolicythat gives four outside clients their roles:fromCIDRrules with HTTP rules under the port, and the three answers a client can get. - The tables behind those answers: CIDR identities, the pod's policy map with its proxy port, and the Envoy proxy.
- The lease on another node: why the address rule stops matching, the two outcomes, and what Hubble shows of it.
- One table of clients against paths for each state of the cluster.
- Three ways out, each one run: the
Localpolicy on the layer 2 Service, the address announced by BGP withLocal, and direct server return. And an identity rule, which can't replace the addresses. - What the video leaves out: how exact the HTTP rule is, what the pod receives from the proxy, BGP under the default traffic policy, and the measured values.
- Where to read further.
Two results up front, both from this lab. One piece of vocabulary they need: each Service's address is announced at layer 2, which means that one node of the rack answers ARP for it. Cilium elects that node, the holder, and records it in a lease. First, a policy that names outside clients by address worked only on the node where the client's packet arrived. On the Service whose lease was held by its pod's own node, the four clients got exactly their roles, in all twenty requests of the test: four clients, five paths each. On a Service whose lease was held by another node, with the same policy, all twenty requests timed out, the admin's included. With one more rule on the pods, a rule that lets the cluster's own nodes and pods reach the port, all twenty were answered, the blocked client's included. Second, which Service is which can change with no object touched. Cilium's agent on the holder, its process on that node, was restarted. The leases went to the other node of the rack and stayed there, and the Service that had been right was open to all four clients.