Set a custom external IP address for the DHCP service¶
Available since Container Cloud 2.25.0 (Cluster release 16.0.0)
This section instructs you on how to set a custom external IP address for
the dhcp-lb
service so that it remains the same during management cluster
upgrades and other LCM operations.
The changes of dhcp-lb
service address may lead to the necessity of
changing configuration for DHCP relays on ToR switches.
The described procedure allows you to avoid such unwanted changes.
This configuration makes sense when you use multiple DHCP address ranges
on your deployment. See Configure multiple DHCP address ranges for details.
To set a custom external IP address for the dhcp-lb service:
In the
Cluster
object of the management cluster, modify the configuration of thebaremetal-operator
release by settingdnsmasq.dedicated_udp_service_address_pool
totrue
:spec: ... providerSpec: value: kaas: ... regional: - helmReleases: ... - name: baremetal-operator values: dnsmasq: dedicated_udp_service_address_pool: true ... provider: baremetal ...
In the
MetalLBConfig
object of the management cluster, modify theipAddressPools
object list by adding thedhcp-lb
object and theserviceAllocation
parameters for thedefault
object:ipAddressPools: - name: default spec: addresses: - 112.181.11.41-112.181.11.60 autoAssign: true avoidBuggyIPs: false serviceAllocation: serviceSelectors: - matchExpressions: - key: app.kubernetes.io/name operator: NotIn values: - dhcp-lb - name: services-pxe spec: addresses: - 10.0.24.122-10.0.24.140 autoAssign: false avoidBuggyIPs: false - name: dhcp-lb spec: addresses: - 10.0.24.121/32 autoAssign: true avoidBuggyIPs: false serviceAllocation: namespaces: - kaas serviceSelectors: - matchExpressions: - key: app.kubernetes.io/name operator: In values: - dhcp-lb
Select non-overlapping IP addresses for all the
ipAddressPools
that you use:default
,services-pxe
, anddhcp-lb
.In the
MetalLBConfig
object of the management cluster, modify thel2Advertisements
object list by addingdhcp-lb
to theipAddressPools
section in thepxe
object spec:Note
A cluster may have a different
L2Advertisement
object name instead ofpxe
.l2Advertisements: ... - name: pxe spec: ipAddressPools: - services-pxe - dhcp-lb ...