Create a load balancer
Creating a load balancer gives you one public hostname that spreads traffic across the backends you list. It takes one form in the portal or one API call. The load balancer is ready, with status active, as soon as the request finishes.
If you’re new to load balancers, read the Load Balancers overview first.
When to use each protocol
You pick the layer and protocol once, at creation. To change them later, create a new load balancer.
L7 (Layer 7) load balancers read each HTTP request, so they can route by path and header. L4 (Layer 4) load balancers forward whole TCP connections without reading them.
How it works
- You enter a name, a layer and protocol, and one or more backends.
- IBEE creates the routing on its shared load-balancing service, creates a DNS name for it, and sets the status to
active. If any part fails, nothing is kept and you see an error. - Health checks start, and traffic goes only to backends that pass them.
- Billing starts when the status becomes
active.
Before you begin
- A verified organization. Until it is verified, the portal shows Verify Identity instead of Create Load Balancer. See Verify your identity.
- Your backends’ addresses and port. For VMs, use each VM’s public IPv4 address. See Attach VMs.
- The backend port open in each VM’s firewall group. The default firewall group already accepts TCP
80,443and8000–8080. See Firewalls. - A health-check endpoint on each backend, such as
/healthreturning HTTP200, if you use an HTTP check. - Room in your plan. Your plan sets how many load balancers you can have. See Limits and quotas.
Create a load balancer in the portal
Open Load Balancers
In the sidebar, under Network & Security, click Load Balancer. Then click Create Load Balancer. The Create Load Balancer page opens, with a Configuration summary on the right that updates as you fill in the form.
Add backends
Each backend is one row. Click Add backend for each extra server.
Leave Encrypt traffic from the load balancer to this backend unticked. The setting is saved but not applied yet, so the load balancer always connects to backends without encryption. A backend that only accepts TLS on that port will fail.
Set routing and health
Under Routing and health:
- Routing algorithm: Round robin (default), Least request, Random or Consistent hash. See Algorithms.
- Request timeout: how long one request may take, 100–300,000 ms (default
30000, 30 seconds). It applies to Layer 7 load balancers. - Active health check:
See Health checks for what these numbers mean.
Set advanced behavior (optional)
Under Advanced behavior:
- Automatic retries: retries a request that failed with a
5xxresponse, a reset connection or a connection failure. Attempts1–10(default3) and Per-retry timeout (ms) 100–120,000 (default5000). - L7 routing rules (Layer 7 only): click Add rule for each rule, with a Priority (lower numbers are checked first), a Path prefix such as
/api, and an optional Header name and Header value. With no rules, every request goes to your backends. - Sticky sessions and Proxy protocol: saved but not applied to traffic yet. Leave them off.
Create a load balancer with the API
Send a POST to /networking/load-balancers/l7 for HTTP or HTTPS, or to /networking/load-balancers/l4 for TCP or TLS passthrough. Replace 710995 with your workspace ID: the number after /workspaces/ in the portal’s address bar.
Every backend needs "type": "ip" (or "hostname"), because the API’s default type is service. An HTTPS load balancer also needs "tls": {"mode": "terminate"}, and a TLS passthrough one needs "tls": {"mode": "passthrough"}.
The token needs the load-balancer.write scope. A successful call returns 201 with the new load balancer. These are the fields you need next:
If you leave out health_check in the API, no active health check is set up. The portal always sends one.
Verify
-
Open the load balancer’s detail page. The header shows the layer, protocol and status, which should be active. Public endpoint shows the Host, the Listener port and the Public host URL, with copy buttons.
-
Send a request to the endpoint:
For an L4 TCP load balancer, connect to the host and the listener port shown, for example
nc -vz HOST 9012. -
Check the status at any time with
GET /networking/load-balancers/LB-ID/status. It returnsstatus, the endpoint, and anerror_messageif something failed.
To serve the load balancer on your own domain, add a CNAME record at your DNS provider that points to the Host. For an HTTPS load balancer, also see Use your own domain so that the certificate matches your domain.
Change a load balancer
The portal can’t edit a load balancer. You have two options:
- Use the API.
PATCH /networking/load-balancers/l7/LB-IDorPATCH /networking/load-balancers/l4/LB-IDchanges only the fields you send:name,backends,routing,health_check,policy,tls, and for L7 alsorulesandcustom_domain. Abackendsorruleslist replaces the whole existing list. The hostname and port don’t change. - Recreate it. Create a new load balancer with the new settings, move your DNS record to its Host, then delete the old one. The new load balancer has a different hostname.
Delete a load balancer
Deleting a load balancer is permanent. Its hostname stops working and won’t come back; a new load balancer gets a different hostname. Move your DNS records first. Your backend VMs are not deleted.
- On the Load Balancers list, click the delete icon on the load balancer’s row.
- In the Delete Load Balancer dialog, type the load balancer’s name.
- Click Delete Load Balancer. You see “Load balancer deleted successfully”.
With the API: DELETE /networking/load-balancers/LB-ID?workspace_id=710995 returns 204. Billing stops when the deletion completes.
