Disclosure up front: I run IPYE, a company that leases IP space. Most of this article is practical how-to; IPYE appears where a free /48, LOA, or ROA helps you try the work, with a short call to action at the end.

On a bare-metal or VM-based Kubernetes cluster, a LoadBalancer service stays pending forever because there is no cloud load balancer to provision. MetalLB fills that gap. In BGP mode, the cluster nodes announce service addresses to your router, so traffic for each service reaches a node that runs it. With a /48 you can dedicate a whole /64 to service addresses and give every public service its own global IPv6 address. This article sets up MetalLB in BGP mode with addresses from a free IPv6 /48 from IPYE. The examples use 2001:db8:100::/48, nodes on 2001:db8:100:c0::/64, a service pool of 2001:db8:100:c1::/64, and an FRR edge router at 2001:db8:100:c0::1.

The design

  • The cluster nodes speak iBGP or eBGP with a private ASN to your edge router, and announce a /128 for each service address they serve.
  • The edge router accepts only /128s inside the service pool, and only from the node range.
  • The edge announces only the /48 aggregate to the Internet. The /128s never leave your network.

This keeps upstream filters simple, because they only ever see one prefix, while the cluster can create and delete services freely.

Prerequisites

The cluster must support IPv6 services, either single-stack IPv6 or dual-stack. Install MetalLB from its manifests or Helm chart, following the project's documentation, and choose its FRR-based BGP mode. MetalLB's original native BGP implementation only advertises IPv4, so IPv6 services need FRR mode. These examples use MetalLB's custom resources, which are the same in both modes.

MetalLB resources

apiVersion: metallb.io/v1beta1 kind: IPAddressPool metadata: name: public-v6 namespace: metallb-system spec: addresses: - 2001:db8:100:c1::/64 --- apiVersion: metallb.io/v1beta2 kind: BGPPeer metadata: name: edge namespace: metallb-system spec: myASN: 64512 peerASN: 64496 peerAddress: 2001:db8:100:c0::1 --- apiVersion: metallb.io/v1beta1 kind: BGPAdvertisement metadata: name: public-v6 namespace: metallb-system spec: ipAddressPools: - public-v6 aggregationLengthV6: 128 

64512 is a private ASN for the cluster, and 64496 is your edge's public ASN. aggregationLengthV6: 128 announces each service address individually, which is what you want for per-service routing.

Edge router configuration

FRR's dynamic neighbours accept sessions from any node in the node subnet, so you do not have to edit the router when nodes join:

ipv6 prefix-list K8S-SVC seq 10 permit 2001:db8:100:c1::/64 ge 128 le 128 ! route-map K8S-IN permit 10 match ipv6 address prefix-list K8S-SVC ! route-map K8S-OUT deny 10 ! router bgp 64496 neighbor K8S peer-group neighbor K8S remote-as 64512 bgp listen range 2001:db8:100:c0::/64 peer-group K8S address-family ipv6 unicast neighbor K8S activate neighbor K8S route-map K8S-IN in neighbor K8S route-map K8S-OUT out maximum-paths 8 exit-address-family 

The inbound filter accepts /128s inside the service pool and nothing else. A node that tries to announce the /48 or a default route is ignored. The outbound map sends nothing to the nodes, which do not need routes from you. maximum-paths 8 lets the router spread traffic across up to eight nodes announcing the same service address.

Keep the upstream's outbound filter as it is: the /48 only. The service /128s stay internal because that filter never matches them.

A service

apiVersion: v1 kind: Service metadata: name: web annotations: metallb.universe.tf/loadBalancerIPs: 2001:db8:100:c1::443 spec: type: LoadBalancer ipFamilies: [IPv6] ipFamilyPolicy: SingleStack selector: {app: web} ports: - port: 443 targetPort: 8443 

The annotation pins a predictable address, which suits DNS records and firewall rules. Without it, MetalLB picks the next free address from the pool. Recent MetalLB releases use the metallb.io/loadBalancerIPs annotation name, so check which one your version expects.

Verify

kubectl get svc web vtysh -c "show bgp ipv6 unicast 2001:db8:100:c1::443/128" vtysh -c "show bgp summary" 

The service should show the external address. On the router, the /128 should appear with one path per announcing node.

Traffic policy

With externalTrafficPolicy: Cluster, the default, every node announces the service and forwards traffic to pods on other nodes if needed. With externalTrafficPolicy: Local, only nodes that run a pod for the service announce it, so traffic goes straight to a node with a pod and the client's source address is preserved. Local is usually better for public services. Make sure the service has pods on more than one node.

Firewalling

The router forwards to service /128s like any other address. Apply your edge firewall policy to the service pool: allow the ports each service exposes and drop the rest. Kubernetes network policies protect pods, not the network in front of the nodes.

The public side

The /48 is the only thing your upstream sees. Their filter needs the LOA from the IPYE customer area, and a ROA for your origin ASN is published automatically through IPYE's ARIN or APNIC accounts.

Do this next

Request your free /48, reserve a /64 for service addresses, and set up the edge's dynamic neighbour range and /128-only filter before you install MetalLB. Questions: ipye@turnel.com.

About IPYE

IPYE (https://ipye.com) leases IPv4, IPv6 and ASN space with instant setup. Your first IPv6 /48 is free for the first year, a real allocation you can announce on your own ASN, with a LOA from the portal and the ROA created automatically. ASN and region changes apply automatically. IPv4 /24 to /22 leases include LOA, ROA and per-/24 rDNS; WHOIS is editable on IPv6 /44 and larger. Locations: Los Angeles, New York, Ashburn, Salt Lake City, London, Amsterdam, Frankfurt. Claim your free /48: https://my.ipye.com/products/ipv6-rental. Questions: ipye@turnel.com.

Disclosure: I run IPYE