MetalLB Setup

Last Edit: 2023.10.31

Overview

Install the MetalLB application using TrueCharts and configure it as the system load balancer.

Assumptions

Install MetalLB Config

Navigate to the Applications page in the TrueNAS Scale dashboard, Apps on the main navigation.

Switch to the Available Applications tab in the Applications page.

Using the search tool, find the metallb-config application. Verify MetalLB Config is from the TrueCharts catalog and is on the Enterprise train.

Select Install to begin configuration and installation of the application. Configuration options not mentioned in this section can be left as default.

Application Name

SettingValueDescription
Application Namemetallb-configName for the application.
Version Number#.#.#Version to use, latest by default.

App Configuration

All MetalLB app configuration is done in the MetalLB Config application. The MetalLB Config app will always be in the STOPPED state on the TrueNAS Applications dashboard.

SettingValueDescription
IP Address Pools Object--
NamelbpoolIdentifier for the IP pool.
Auto AssigntrueShould MetalLB use this pool when auto assigning IP addresses to applications.
Avoid Buggy IPsfalseWhen true, prevents IPs ending in .0 and .255 from being assigned.
Address Pools--
Adress Pool Entry192.168.1.30-192.168.1.90IP range to use for the pool. Modify for the network, and avoid the DHCP range.
LD Advertisements--
Namel2lbpoolIdentifier for the L2 advertisement.
Address PoolsAddAdd an address pool.
Address Pool EntrylbpoolIP address pool to use.

Save

Verify you have checked the TrueCharts documentation for MetalLB Config and Save. The application will begin installation and deploy. Navigate to the Installed Applications tab to monitor the status.

Install MetalLB

Navigate to the Applications page in the TrueNAS Scale dashboard, Apps on the main navigation.

Switch to the Available Applications tab in the Applications page.

Using the search tool, find the metallb application. Verify MetalLB is from the TrueCharts catalog and is on the Operators train.

Select Install to begin configuration and installation of the application. Configuration options not mentioned in this section can be left as default.

Application Name

SettingValueDescription
Application NamemetallbName for the application.
Version Number#.#.#Version to use, latest by default.

Save

Verify you have checked the TrueCharts documentation for MetalLB and Save. The application will begin installation and deploy. Navigate to the Installed Applications tab to monitor the status.

Disable Integrated Load Balancer

Navigate to the Applications page of the TrueNAS dashboard. In the

Applications Advanced Settings.

Find the configuration value Enable Integrated Loadbalancer and set it to false by de-selecting the checkbox.

Select Save at the bottom of the Kubernetes Settings. The integrated load balancer will be disabled and all applications will be restarted. Once restarted, they will be using MetalLB as their load balancer.

Applications Advanced Settings.

Assign Apps IP Addresses

With MetalLB setup, it is now possible to assign applications IP addresses on the network, instead of using the TrueNAS IP. When assigning an IP to an application, the IP address must be within the configured IP Address Pool range from the MetalLB Config. If no IP is assigned, an unused address from the configured range will be used.

Refer to the Networking and Services settings for a given application to configure the MetalLB IP address to use. Only do this for applications that should be exposed to the network. Services exposed via ingress should continue to use a ClusterIP.

SettingValueDescription
Service TypeLoadBalancer (Expose Ports)Must be a LoadBalancer service to use the load balancer.
LoadBalancer IP192.168.1.36An IP address within the configured pool range, used for the service.

Applications Advanced Settings.

References

1 2 3 4