Replies: 1 comment 6 replies
|
Every service is not exposed to NetBird just because you run a NetworkRouter. Only those that have a NetworkResource attached will be reachable from outside of the cluster. I am not really following your argument about the operator becoming a load balancer. Could you give more details? |
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
What the operator currently does is deploy Netbird clients into a Kubernetes cluster and route Kubernetes services (defined via HTTPRoute) out of it. The ClusterIP of each service is assigned to these deployed Netbird clients as a routable IP - and that's basically it.
You could achieve the same thing without deploying any Netbird clients into Kubernetes at all, since the service CIDR is reachable from any k8s node. Just create a Netbird network with the k8s nodes as routing peers, add the service CIDR as a resource, create some DNS entries pointing to those IPs, and you're done.
But here's the catch: as long as a subnet/CIDR is pinned to a single host and only routed locally, you can do whatever you want. The moment you turn it into a routable network across your infrastructure, you have to make sure it's well-defined and that routing is unambiguous - no loops, no collisions, and so on.
Kubernetes service CIDRs are very large - something like 10.96.0.0/12 by default. That's for a single cluster, and the range has to accommodate a unique IP for every service across the whole cluster. ClusterIPs get allocated unpredictably across the entire range, so to catch all of them you have to advertise the whole CIDR - even if only a handful of services are live. So even if you only have 100 services you want to expose (through Netbird), you still have to lock down ~1 million IPs and guarantee there are no collisions. And if you add a second cluster, there go another million IPs - and you also have to ensure the two service CIDRs don't overlap. That's why people don't actually do it this way and use load balancers instead: you use a much smaller subnet and only route the services you actually need.
Where this leaves the operator. There are really two coherent directions it can go, in my opinion. Either it becomes a full-fledged Kubernetes load balancer in its own right - owning a small, dedicated LB CIDR, assigning addresses from it to Service objects, and advertising only those addresses into the Netbird network. Or it attaches to an existing LB (Cilium LB-IPAM, kGateway, MetalLB, etc.), letting that component own IP allocation while the operator manages the overlay side: advertising the LB CIDR through a routing peer, wiring up DNS for the allocated addresses etc..
All reactions