Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions docs/en/configure/networking/functions/configure_metallb.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ Please ensure that you have read the [Installation](../../../networking/operator

5. Click **Create**.

> Note:
> When you use BGP mode, allow TCP port 179 between each BGP peer and the MetalLB speaker nodes. If you configure a custom peer port, allow the configured port instead.

## Configure an External IP Address Pool with L2Advertisement or BGPAdvertisement by using the CLI

```yaml
Expand Down Expand Up @@ -114,6 +117,77 @@ spec:
kubectl apply -f ippool-with-L2advertisement.yaml -f ippool-with-bgpadvertisement.yaml
```

## Monitor MetalLB

After you configure MetalLB, you can use the built-in dashboard and monitoring metrics to observe IP address allocation and BGP session status.

> Note:
> The built-in MetalLB dashboard is available in ACP 4.4.

### View the built-in MetalLB dashboard

1. Go to **Operations Center**.

2. In the left navigation bar, click **Monitoring** > **Monitoring Dashboards**.

3. Search for **MetalLB**, and then open the dashboard.

The built-in MetalLB dashboard includes the following panels:

| Panel | Description |
| --- | --- |
| **Exposed Services** | The number of LoadBalancer Services currently announced by MetalLB. |
| **Available IPs** | The number of IP addresses still available across all address pools. |
| **Established BGP Sessions** | The number of BGP sessions that are currently established. |
| **Advertised Prefixes** | The number of BGP prefixes currently advertised by MetalLB. |
| **Pool Usage Trend** | The IP address usage trend for selected address pools. |
| **Selected Pool Capacity** | The used and available IP address capacity for selected address pools. |

### Access the MetalLB metrics endpoint

MetalLB exposes controller and speaker metrics through monitor Services in the `metallb-system` namespace. You can access these metrics from inside the cluster to confirm whether the components expose metrics correctly.

Check the MetalLB monitor Services:

```bash
kubectl get svc -n metallb-system | grep monitor
```

Check the Service endpoints:

```bash
kubectl get endpointslice -n metallb-system -l kubernetes.io/service-name=controller-monitor-service
kubectl get endpointslice -n metallb-system -l kubernetes.io/service-name=speaker-monitor-service
```

The endpoint addresses use port `17472` by default.

Query the controller metrics endpoint from inside the cluster:

```bash
curl -s http://<controller-endpoint-address>:17472/metrics | grep '^metallb_'
```

Query a speaker metrics endpoint from inside the cluster:

```bash
curl -s http://<speaker-endpoint-address>:17472/metrics | grep '^metallb_'
```

If the command returns MetalLB metrics, the component metrics endpoint is available.

### MetalLB metrics reference

The built-in MetalLB dashboard uses the following metrics:

| Metric | Source component | Description | Usage scenario |
| --- | --- | --- | --- |
| `metallb_speaker_announced` | Speaker | Indicates whether a LoadBalancer Service is announced from a speaker node. | Check which nodes announce LoadBalancer Services. |
| `metallb_allocator_addresses_total` | Controller | Total number of IP addresses in address pools. | Calculate total pool capacity and available IPs. |
| `metallb_allocator_addresses_in_use_total` | Controller | Number of IP addresses already allocated from address pools. | Calculate used IPs and pool usage trend. |
| `metallb_bgp_session_up` | Speaker / BGP exporter | Indicates whether BGP sessions are established. | Check BGP session health. |
| `metallb_bgp_announced_prefixes_total` | Speaker / BGP exporter | Number of BGP prefixes announced by MetalLB. | Check route advertisement status. |

## Troubleshooting MetalLB

| Symptom | Possible Cause | Resolution |
Expand Down