v0.16.1

Configure MetalLB for Layer 2, BGP, and BFD with FRR-K8s.

EKS Anywhere supports BGP and BFD through the FRR-K8s backend. FRR-K8s is enabled by default in MetalLB v0.16.1. The deprecated speaker.frr backend is not supported by EKS Anywhere; leave speaker.frr.enabled set to false.

Configuring MetalLB in the EKS Anywhere package spec

Layer 2 example

For a Layer 2 installation that does not use BGP, you can disable FRR-K8s:

apiVersion: packages.eks.amazonaws.com/v1alpha1
kind: Package
metadata:
  name: mylb
  namespace: eksa-packages-<cluster-name>
spec:
  packageName: metallb
  targetNamespace: metallb-system
  config: |
    frrk8s:
      enabled: false
    IPAddressPools:
      - name: default
        addresses:
          - 10.220.0.93-10.220.0.95
    L2Advertisements:
      - ipAddressPools:
          - default    

Replace the example addresses with unused addresses on your network.

BGP and BFD example

Install the MetalLB package, then create a BFDProfile in its target namespace:

apiVersion: metallb.io/v1beta1
kind: BFDProfile
metadata:
  name: bfd
  namespace: metallb-system
spec:
  receiveInterval: 300
  transmitInterval: 300
  detectMultiplier: 3

Apply the profile with kubectl apply -f bfd-profile.yaml, then configure a BGP peer that references it:

apiVersion: packages.eks.amazonaws.com/v1alpha1
kind: Package
metadata:
  name: mylb
  namespace: eksa-packages-<cluster-name>
spec:
  packageName: metallb
  targetNamespace: metallb-system
  config: |
    frrk8s:
      enabled: true
    IPAddressPools:
      - name: bgp
        addresses:
          - 10.220.0.97-10.220.0.99
    BGPAdvertisements:
      - ipAddressPools:
          - bgp
    BGPPeers:
      - name: router
        myASN: 64512
        peerASN: 64513
        peerAddress: 192.0.2.1
        bfdProfile: bfd    

Replace the pool, peer address, and AS numbers with your network configuration. Configure the router to peer with the cluster nodes and enable BFD on the router. FRR-K8s manages FRRouting for MetalLB; BFD lets FRRouting detect a failed peer and close the associated BGP session. The BFDProfile is a separate Kubernetes resource, not a BFDProfiles entry in the Package configuration.

After the package is installed, check the workloads and peer status:

kubectl get pods -n metallb-system
kubectl get bgppeers,bfdprofiles -n metallb-system
kubectl get frrnodestates
kubectl get bgpsessionstates -n metallb-system

EKS Anywhere pins the package’s images by digest. Upstream frr-k8s image tag settings do not select different images in this package. For registry mirrors and disconnected clusters, follow the registry mirror instructions and the package copying instructions .

Configuration parameters

Parameter Description Default Required
IPAddressPools[] Address pools. See IPAddressPool. None False
L2Advertisements[] Layer 2 advertisements. See L2Advertisement. None False
BGPAdvertisements[] BGP advertisements. See BGPAdvertisement. None False
BGPPeers[] BGP peers. See BGPPeer. None False
frrk8s FRR-K8s backend settings. See frrk8s. Enabled False
speaker Speaker settings. See speaker. None False
IPAddressPool Addresses that MetalLB can assign to LoadBalancer services.
name Address pool name. None True
addresses[] CIDR prefixes or explicit start-end address ranges. None True
autoAssign Allow automatic allocation from this pool. true False
L2Advertisement Advertise the selected pools through Layer 2.
name Advertisement name. Generated False
ipAddressPools[] Address pool names. None False
BGPAdvertisement Advertise the selected pools through BGP.
name Advertisement name. Generated False
aggregationLength IPv4 aggregation prefix length. 32 False
aggregationLengthV6 IPv6 aggregation prefix length. 128 False
communities[] BGP communities, such as 64512:100, or aliases from a Community resource. None False
ipAddressPools[] Address pool names. None False
localPref BGP local preference. None False
peers[] Peer names to advertise to. An empty list advertises to all peers. All peers False
BGPPeer A BGP peer.
name Peer name. Generated False
myASN Local autonomous system number. None True
peerASN Remote autonomous system number. None True
peerAddress Remote peer address. None True
peerPort Remote BGP port. 179 False
holdTime Requested BGP hold time. None False
keepaliveTime Requested BGP keepalive time. None False
bfdProfile Name of a BFDProfile in the same namespace. None False
routerID Router ID for the BGP session. None False
sourceAddress Local source address for the session. None False
password Password for TCP MD5 authentication. None False
passwordSecret Reference to a kubernetes.io/basic-auth Secret with the password under the password key. None False
frrk8s FRR-K8s backend settings.
enabled Enable the FRR-K8s backend. true False
speaker Service announcement settings.
ignoreExcludeLB Ignore the node.kubernetes.io/exclude-from-external-load-balancers node label. false False

Announcing from nodes excluded by default

To allow service announcements from nodes with the exclusion label, configure:

apiVersion: packages.eks.amazonaws.com/v1alpha1
kind: Package
metadata:
  name: mylb
  namespace: eksa-packages-<cluster-name>
spec:
  packageName: metallb
  targetNamespace: metallb-system
  config: |
    speaker:
      ignoreExcludeLB: true