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:

  1. In the Cluster object of the management cluster, modify the configuration of the baremetal-operator release by setting dnsmasq.dedicated_udp_service_address_pool to true:

    spec:
      ...
      providerSpec:
        value:
          kaas:
            ...
            regional:
              - helmReleases:
                ...
                - name: baremetal-operator
                  values:
                    dnsmasq:
                      dedicated_udp_service_address_pool: true
                      ...
                provider: baremetal
              ...
    
  2. In the MetalLBConfig object of the management cluster, modify the ipAddressPools object list by adding the dhcp-lb object and the serviceAllocation parameters for the default 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, and dhcp-lb.

  3. In the MetalLBConfig object of the management cluster, modify the l2Advertisements object list by adding dhcp-lb to the ipAddressPools section in the pxe object spec:

    Note

    A cluster may have a different L2Advertisement object name instead of pxe.

    l2Advertisements:
    ...
    - name: pxe
      spec:
        ipAddressPools:
        - services-pxe
        - dhcp-lb
        ...