In some environments, you’ll have some large address pools of “cheap” private IPs (e.g. RFC1918), and some smaller pools of “expensive” IPs (e.g. leased public IPv4 addresses).
By default, MetalLB will allocate IPs from any configured address pool with free addresses. This might end up using “expensive” addresses for services that don’t require it.
To prevent this behaviour you can disable automatic allocation for a pool
by setting the autoAssign
flag to false
:
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: cheap
namespace: metallb-system
spec:
addresses:
- 192.168.10.0/24
apiVersion: metallb.io/v1beta1
kind: IPAddressPool
metadata:
name: expensive
namespace: metallb-system
spec:
addresses:
- 42.176.25.64/30
autoAssign: false
Addresses can still be specifically allocated from the “expensive” pool with the methods described in the usage section.
To specify a single IP address in a pool, use /32
in the CIDR notation
(e.g. 42.176.25.64/32
).
Some old consumer network equipment mistakenly blocks IP addresses
ending in .0
and .255
, because of
misguided
smurf protection.
If you encounter this issue with your users or networks, you can
use a range of IPs of the form 192.168.10.1-192.168.10.254
to avoid
problematic IPs.