Skip to content

Configure Multiple Load Balancers

This feature was introduced in Hydrolix version 5.7.4.

The extra_loadbalancers tunable provisions additional Traefik load balancer services. Each additional service beyond the default traefik service interacts independently with external, cloud load balancer provisioning APIs.

Additional load balancers provide flexibility for handling high-traffic and advanced networking requirements.

When to use multiple load balancers⚓︎

Multiple load balancers are useful in several scenarios:

  • High connection volumes: In busy clusters with sustained high traffic, additional load balancers distribute the connection load across multiple endpoints.
  • Independent address family support: Deploy separate load balancers for IPv4 and IPv6, allowing independent configuration and management of each address family.
  • Traffic isolation: Separate load balancers for different traffic types or services, improving fault isolation and traffic management.
  • Regional or availability zone distribution: Distribute load balancers across different network boundaries for improved resilience.

Configuration⚓︎

Set the extra_loadbalancers tunable in the hydrolixcluster.yaml file under spec::

Configure Extra Load Balancers
spec:
  extra_loadbalancers: 2

The value specifies the number of additional load balancers to create. When configured:

  • extra_loadbalancers: 0 (default): Only the standard traefik service exists
  • extra_loadbalancers: 1: Creates traefik and traefik-extra-1
  • extra_loadbalancers: 2: Creates traefik, traefik-extra-1, and traefik-extra-2

Service naming⚓︎

Additional load balancer services follow the naming pattern traefik-extra-<N>, where <N> is a sequential number starting from 1. The original traefik service remains unchanged.

Scaling down⚓︎

Reducing the extra_loadbalancers value removes the highest-numbered services first.

Before scaling down⚓︎

Current Configuration
spec:
  extra_loadbalancers: 3

This creates four services:

  • traefik
  • traefik-extra-1
  • traefik-extra-2
  • traefik-extra-3

After scaling down⚓︎

Scaled Down Configuration
spec:
  extra_loadbalancers: 1

This removes the highest-numbered services, leaving:

  • traefik
  • traefik-extra-1

The services traefik-extra-3 and traefik-extra-2 are removed in that order.

Warning

Ensure traffic is properly drained from a load balancer before removing it to avoid connection disruptions.

Example: IPv4 and IPv6 separation⚓︎

This example configures separate load balancers for IPv4 and IPv6 traffic:

IPv4 and IPv6 Separation Example
1
2
3
4
  spec:
    extra_loadbalancers: 1
    # Additional cloud-provider-specific configuration required
    # to assign IPv4/IPv6 addresses to respective load balancers

After applying this configuration, use the cloud provider's tools to assign the appropriate address families to each service:

  • traefik: Configured for IPv4
  • traefik-extra-1: Configured for IPv6

The specific steps depend on the cloud provider.

Consult the relevant cloud load-balancer pages

Verification⚓︎

After configuring additional load balancers, verify the services are created:

Verify Load Balancer Services
kubectl get svc -n <namespace> | grep traefik

Expected output when extra_loadbalancers: 2:

Example Output
1
2
3
traefik          LoadBalancer   10.0.0.1   203.0.113.10   80:30080/TCP,443:30443/TCP
traefik-extra-1  LoadBalancer   10.0.0.2   203.0.113.11   80:30081/TCP,443:30444/TCP
traefik-extra-2  LoadBalancer   10.0.0.3   203.0.113.12   80:30082/TCP,443:30445/TCP