Add IP address pools

MKE allows you to add IP address pools once MetalLB has been deployed in the MKE cluster. To do this, you use an MKE configuration file.

  1. Verify that the enabled parameter setting for the cluster_config.metallb_config configuration option is set to true.

  2. Update the cluster_config.metallb_config configuration option with the details for the new IP address pools.

    [cluster_config.metallb_config]
      enabled = true
    
    [[cluster_config.metallb_config.metallb_ip_addr_pool]]
          name = "<IP-address-pool-name-1>”
          external_ip = ["192.168.10.0/24", "192.168.1.0/24"]
    
    [[cluster_config.metallb_config.metallb_ip_addr_pool]]
          name = "<IP-address-pool-name-2>”
          external_ip = ["52.205.10.1/24"]
    
    [[cluster_config.metallb_config.metallb_ip_addr_pool]]
          name = "<IP-address-pool-name>-3”
          external_ip = ["54.205.10.0/24"]
    

    Caution

    • Make sure to provide correct IP addresses in CIDR format.

    • MetalLB pool name values must adhere to the RFC 1123 international format:

      A lowercase RFC 1123 subdomain must consist of lower case alphanumeric characters, - or ., and must start and end with an alphanumeric character. For example, example.com, regex used for validation is ‘[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*’)

    Example IP address pool settings:

    [cluster_config.metallb_config]
        enabled = true
        [[cluster_config.metallb_config.metallb_ip_addr_pool]]
            name = "example1"
            external_ip = ["192.168.10.0/24", "192.168.1.0/24"]
    
        [[cluster_config.metallb_config.metallb_ip_addr_pool]]
            name = "example2"
            external_ip = ["52.205.10.1/24"]
    

    When multiple address pools are configured, MKE advertises all of the pools by default. To request assignment from a specific pool, users can add metallb.universe.tf/address-pool annotation to the service, with the name of the address pool as the annotation value. In the event that no such annotation is added, MetalLB will assign an IP from one of the configured pools.

    You can configure both public and private IPs, based on your environment. MKE allows you to define unlimited address pools and is type-agnostic.

  3. Upload the modified MKE configuration file and allow at least 5 minutes for MKE to propagate the configuration changes throughout the cluster.

Note

Following the addition of your IP address pools, Mirantis recommends that you verify your MetalLB deployment.