Creating an External IP Pool
An external IP pool is a collection of IP addresses. MetalLB retrieves IPs from the external ip pool to provide external access IPs for LoadBalancer type service.
Prerequisites
To use a BGP type external IP pool, please contact the administrator to enable the related features.
Notes
BGP mode does not support the IPv6 protocol.
Constraints and Limitations
The IP resources of the external IP pool need to meet the following conditions:
-
The external IP pool in L2 mode must be Layer 2 reachable with available nodes.
-
The IPs must be directly usable by the platform and must not include IPs already used by the physical network, such as gateway IPs.
-
The IPs must not overlap with the network used by the cluster, including Cluster CIDR, Service CIDR, subnets, etc.
-
In a dual-stack environment, ensure that both IPv4 and IPv6 addresses are present in the same external IP pool and that the number of each is greater than 0; otherwise, the dual-stack LoadBalancer type service will not be able to obtain an external access address.
-
In an IPv6 environment, the DNS of the nodes must support IPv6, otherwise the MetalLB plugin cannot be successfully deployed.
Deploying the MetalLB Plugin
Using the external IP pool relies on the MetalLB plugin.
Steps
-
In the left navigation bar, click Clusters > Clusters.
-
Click the cluster name of the cluster where the plugin is to be deployed.
-
On the Plugins tab, click
next to MetalLB > Deploy. -
Wait for the deployment status to become Deployed to complete the deployment.
Creating an External IP Pool
-
In the left navigation bar, click Networking > External IP Pools.
-
Click Create External IP Pools.
-
Configure some parameters according to the following descriptions.
Parameter Description Type - L2: Communicates and forwards based on MAC addresses, suitable for small-scale or local networks requiring simple and fast Layer 2 switching, with advantages of simple configuration and low latency.
- BGP (Alpha): Routes and forwards based on IP addresses, using the BGP protocol to exchange routing information, suitable for large-scale networks requiring complex routing and spanning multiple autonomous systems, with advantages of high scalability and high reliability.
IP Resources Supports input in the form of CIDR and IP ranges, click Add to support multiple inputs, examples are as follows:
CIDR:192.168.1.1/24.
IP Range:192.168.2.1~192.168.2.255.Available Nodes By default, all nodes are selected. You can click the drop-down box to select labels to filter available nodes. Click Show node detail to view information about the available nodes.
Note: When using the BGP type, the available nodes are the next-hop nodes, ensure that the selected available nodes are a subset of the BGP connection nodes .BGP Peer Select BGP peers, refer to BGP Peer for specific configuration details. -
Click Create.
Viewing Alert Policies
-
In the left navigation bar, click Networking > External IP Pools.
-
Click View Rules in the upper right corner of the page to view the general alert policies for MetalLB.