Like some other load-balancer implementations, MetalLB accepts the
spec.loadBalancerIP field in the service specification.
If the requested IP address is within a range from any address pool, MetalLB assigns the requested IP address.
If the requested IP address is not within any range, MetalLB reports a warning.
Example service YAML for a specific IP address
- port: 8080
If MetalLB cannot assign the requested IP address, the
EXTERNAL-IP for the service reports
<pending> and running
oc describe service <service_name> includes an event like the following example.
Example event when MetalLB cannot assign a requested IP address
Type Reason Age From Message
---- ------ ---- ---- -------
Warning AllocationFailed 3m16s metallb-controller Failed to allocate IP for "default/invalid-request": "18.104.22.168" is not allowed in config