MetalLB Application Load Balancer Addon

Introduction

MetalLB is an open-source Load balancer implementation based on standard routing protocols for bare-metal Kubernetes. It specifically handles the ServiceType: Loadbalancer settings, which provides users with a more granular ability to control how IP addresses are assigned.

Description

In our latest UI, users can modify the configuration for the IP Range at any stage of the cluster lifecycle. It provides:

  • Address Allocation – MetalLB assigns and unassigning individual addresses to services as required, but only from IPs that are part of its defined pool.
  • External Announcement – After MetalLB has assigned an external IP address to a service, it ensures the external network outside the cluster is aware that the IP resides within the cluster. MetalLB uses the typical routing protocols like ARP, NDP, or BGP to achieve this..

Settings

MetalLB is not enabled by default on BareOS clusters. It can be enabled and configured during cluster creation or post cluster creation.

Enabling MetalLB during cluster creation

During cluster creation, PMK provides the option to enable MetalLB for the cluster in the Cluster Add-ons sections.

Read MetalLB configuration documentation here: https://metallb.universe.tf/configuration/

With PMK 5.10 all MetalLB configurations are moved to the Custom Resources by default. Clusters with older configuration will working, but it is recommended to re-configure MetalLB with CRDs.

It can deployed in following modes:

  • Layer 2 Mode (Default)
    • IP address pool range needs to provided and it creates the following CR on the clusters.
yaml
Copy
  • Advanced Configuration

Example:

YAML
Copy

Enabling MetalLB post cluster creation

Go to Infrastructure > Cluster > Add-ons tab and click Edit Add-ons.

Under Configurable Add-ons, enable MetalLB.

Once enabled, you need to also specify the IP address pool(s) that MetalLB can use to allocate IP addresses to services that are created with type LoadBalancer. PMK will then deploy MetalLB as a Kubernetes application within the cluster, under the metallb-system namespace.

You can add multiple IP ranges by clicking the + Add Address Pool Range .

MetalLB is currently inoperative when used in BGP mode for IPv6. This is a limitation with MetalLB itself but is under active development. Additionally, In order for MetalLB to function correctly, privileged mode must be enabled for running containers on the cluster.

YAML Specifications

YAML
Copy

The base64EncMetallbConfig field can be added to any configuration that MetalLB supports. For example, if two address pools are required, then the following configuration can be applied.

Bash
Copy

Data shall be encoded as base64 and used as the override parameter, in the cluster Addon sunpike object.

YAML
Copy

Qbert API support

Qbert cluster create API supports following parameter from PMK 5.10 onwards to configure MetalLB during cluster creation:

PMK 5.10 onwards:

YAML
Copy

The base64EncMetallbConfig should be a base64 encoded string with MetalLB Custom Resource Configuration yaml eg:

YAML
Copy

Base64 encoded form of above yaml :

YAML
Copy

Before PMK 5.10:

The following parameter was used instead of the new base64EncMetallbConfig (Added in PMK 5.10)

metallbCidr: {type: string, description: "If enableMetallb is true, specify the comma-separated pools of IPs that MetalLB will manage (for example: A.B.C.D-E.F.G.H, I.J.K.L-M.N.O.P)"},

Existing clusters with older configuration will keep working when upgraded to PMK 5.10, but it is recommended to migrate to new configuration.

Migrating MetalLB configuration from configMap to Custom Resources

  • Instructions to convert config map to CRs are present here: https://metallb.universe.tf/configuration/migration_to_ crds/
  • Go to Infrastructure > Desired clusters > Add-ons > Edit Add-ons(Button) > MetalLB > Edit Configuration(Button)
  • The existing configMap configuration should appear as below. Replace the configuration with new Custom Resource configuration and click Save Changes.
MetalLB with config map type configuration

MetalLB with config map type configuration

MetalLB with Custom Resource type configuration

MetalLB with Custom Resource type configuration

Conclusion

Add-ons are updated along with the pf9-kube version and can be referenced in the Support Matrix article. For additional assistance, contact our support team. For additional assistance with this addon, contact our support team.

Type to search, ESC to discard
Type to search, ESC to discard
Type to search, ESC to discard
  Last updated by Anmol Sachan