Skip to content

Load Balancers ​

A load balancer distributes incoming traffic across a pool of backend instances. Frostmoln offers two types; you choose one at create time — it can't be changed in place (to switch, delete and recreate).

Choosing a type ​

l7 (default)l4
LayersL4 and L7 (HTTP/HTTPS)L4 only (TCP/UDP/SCTP)
TLS terminationYes (via the platform key manager)No
PROXY protocol / header insertionYesNo
Source IP to backendsX-Forwarded-For (L7) or PROXY protocol (L4)Preserved natively (L4)
OverheadRuns a load-balancer instanceNo instance (built into the network fabric)
Best forWeb apps, TLS, HTTP routingHigh-throughput L4, source-IP-sensitive workloads
bash
fm network load-balancer create --name web-lb --vpc my-vpc --subnet my-subnet              # l7 (default)
fm network load-balancer create --name l4-lb  --vpc my-vpc --subnet my-subnet --type l4    # l4

fm network lb is an alias for fm network load-balancer. In Terraform the resource is frostmoln_load_balancer and the attribute is type (type is immutable / force-new).

The older root commands fm load-balancer and fm lb still work, but are deprecated; use fm network load-balancer.

Internal vs public ​

A load balancer is internal by default (a private VIP reachable within the VPC). For a public one, allocate a public IP first and pass it:

bash
fm network load-balancer create --name web-lb --vpc my-vpc --subnet my-subnet \
  --scheme public --public-ip <public-ip-id>

Listeners — and required allowed-CIDRs ​

A listener accepts traffic on a protocol/port (e.g. HTTPS:443). Listeners are deny-by-default: you must specify the client CIDRs allowed to reach them — this is required, not optional. Use 0.0.0.0/0 to accept from anywhere.

bash
fm network load-balancer listener create --lb web-lb --name https \
  --protocol https --port 443 --allowed-cidr 0.0.0.0/0

On an l4 load balancer 0.0.0.0/0 is the only accepted value, and the listener shows all sources: a layer-4 load balancer passes every source on and preserves the client IP, so restrict sources in the backend members' security group instead.

Pools, members, and health monitors ​

  • A pool is the set of backend members, with a load-balancing algorithm: round_robin (default), least_connections, or source_ip. (Pools on an l4 load balancer must use source_ip_port.)
  • Members are backend instances (address + port, optional weight, optional backup). Members outside the load balancer's subnet need the cross-subnet flag.
  • A health monitor probes members (tcp / http / https, with delay, timeout, retries, and for HTTP a path + expected codes) and removes unhealthy ones from rotation.
bash
fm network load-balancer pool   create --lb web-lb --name web-pool --protocol http --algorithm round_robin
fm network load-balancer member create --pool web-pool --address 10.0.1.10 --port 8080
fm network load-balancer health-monitor create --pool web-pool --type http --url-path /healthz

TLS, PROXY protocol, and source IP (l7) ​

  • TLS termination — create a terminated_https listener referencing a TLS certificate; the load balancer terminates TLS and forwards to the pool. (l7 only.)
  • PROXY protocol (v1/v2) — preserves the real client IP to L4 backends; your members must be configured to accept the PROXY header. (l7 only.)
  • Source IP: on an l4 load balancer the client IP is always preserved. On an l7 one it depends on the listener: an L7 listener terminates the connection, so read the client IP from X-Forwarded-For; an L4 listener preserves it, or use PROXY protocol to pass it explicitly.

Status and stats ​

A provisioned load balancer reads one of three statuses, based on the health checks of its members:

  • active: every member that should serve traffic passes its health check.
  • degraded: at least one such member fails, but every pool still has a member that passes. Traffic keeps flowing to the healthy members; fix the failing members or the health check.
  • down: some pool has no member that passes, so that pool's traffic has nowhere to go.

A pool without members is not counted, so an empty pool keeps a load balancer active. A load balancer moves to a worse status only after the problem has lasted for about two and a half minutes, so a short restart doesn't change it; it goes back to active as soon as the members pass again. A degraded or down load balancer is still editable. An l7 load balancer reports traffic counters (connections, bytes, errors) plus per-member health; an l4 one reports member health only (no counters).

Attach a public IP for public reach and allow the listener ports in the relevant security group.