An external IP address pool is a collection of IPs that MetalLB utilizes to obtain external access IPs for LoadBalancer type internal routes.
If you need to use a BGP type external IP address pool, please contact the administrator to enable the relevant features.
The IP resources for the external address must meet the following conditions:
The external address pool must be layer 2 (L2) interconnected with available nodes.
The IPs must be usable by the platform and cannot include IPs already in use by the physical network, such as gateway IPs.
There must be no overlap with the networks used by the cluster, including Cluster CIDR, Service CIDR, subnets, etc.
In a dual-stack environment, ensure that both IPv4 and IPv6 addresses exist simultaneously in the same external address pool, and their counts are both greater than 0. Otherwise, dual-stack LoadBalancer type internal routes will not be able to obtain external access addresses.
In an IPv6 environment, nodes' DNS must support IPv6; otherwise, the MetalLB plugin cannot be successfully deployed.
Using the external address pool relies on the MetalLB plugin.
Go to Platform Management.
In the left navigation bar, click Marketplace > Cluster Plugin.
Search MetalLB, click on MetalLB to the right of ⋮ > Deploy.
Wait until the deployment status shows Deployment Successful to complete the deployment.
BGP mode:
Q: What is L2Advertisement
?
A:
L2Advertisement
is a Custom Resource (CRD) provided by the MetalLB to control which IP address pool addresses should be broadcast via ARP (IPv4) or NDP (IPv6) in Layer 2 mode.Q: What is the purpose of L2Advertisement
?
A:
Specifying which IP addresses in the IPAddressPool to L2 broadcast to (ARP/NDP advertisements);
Control broadcast behaviour to prevent IP conflicts or cross-segment broadcasts;
Restricting the broadcast range in multi-NIC, multi-network environments.
In short, it tells MetalLB: which IPs can broadcast and to whom (e.g., which nodes).
Without defining a L2Advertisement
in Layer2 mode, MetalLB will not advertise any addresses.
Q: What is BGPAdvertisement
in MetalLB?
A:
BGPAdvertisement
is a Kubernetes Custom Resource Definition (CRD) used in MetalLB, a load-balancer implementation for bare-metal Kubernetes clusters. It controls how IP address ranges (defined in IPAddressPool
) are advertised to external networks via BGP (Border Gateway Protocol).
Q: Why is BGPAdvertisement
Important?
A:
In MetalLB's BGP mode, the controller peers with external routers using BGP and advertises the IPs assigned to Kubernetes Service
objects. The BGPAdvertisement
resource allows you to:
Control which address pools are advertised
Customize route advertisement settings like:
Route aggregation
BGP communities
Local preference (BGP priority)
Without defining a BGPAdvertisement
, MetalLB will not advertise any addresses, even if you have configured BGP peers.
Go to Platform Management.
In the left navigation bar, click Network Management > External IP Address Pool.
Click Create External IP Address Pool.
Refer to the following instructions to configure certain parameters.
Parameter | Description |
---|---|
Type |
|
IP Resources | Support input in CIDR and IP range formats. Click Add to support multiple entries, examples as follows: CIDR: 192.168.1.1/24 .IP Range: 192.168.2.1 ~ 192.168.2.255 . |
Available Nodes | In L2 mode, available nodes are those used to carry all VIP traffic; in BGP mode, available nodes are those used to carry VIPs, establish BGP connections with peers, and announce routes externally.
|
BGP Peers | Select BGP peers; please refer to BGP Peers for specific configurations. |
Click Create.
Go to Platform Management.
In the left navigation bar, click Network Management > External IP Address Pool.
Click View Alarm Policy in the upper right corner of the page to view the general alarm policy for MetalLB.