Setup MetalLB L2 Advertisement configuration

  1. Copy sample L2Advertisement configuration for MetalLB from the same documentation url (step #16)

    or

    Use single-nic-vlan-metallb-l2-advertisements.sample file.

  2. Create a copy of sample config to create MetalLB L2 Advertisement configuration file.

    cp single-nic-vlan-metallb-l2-advertisements.sample osp-ng-metallb-l2-advertisements.yaml
  3. Edit the file for use with your preferred editor.

    vi osp-ng-metallb-l2-advertisements.yaml
  4. Change the configuration as per your setup. You may just need to chance the interface names as per the network configuration table.

  5. Lastly, configure a L2Advertisement resource which will define which node advertises a service to the local network which has been preconfigured for your lab environment:

    oc apply -f osp-ng-metallb-l2-advertisements.yaml
  6. Verify the configuration:

    oc get l2advertisements.metallb.io -n metallb-system
    Sample output
    NAME          IPADDRESSPOOLS    IPADDRESSPOOL SELECTORS   INTERFACES
    ctlplane      ["ctlplane"]                                ["enp1s0"]
    internalapi   ["internalapi"]                             ["enp1s0.20"]
    storage       ["storage"]                                 ["enp1s0.21"]
    tenant        ["tenant"]                                  ["enp1s0.22"]