CLI: Load Balancer Management
Manage load balancers with the agentmetal lb subcommand.
CLI: Load Balancer Management
Overview
The agentmetal lb subcommand manages load balancers for distributing traffic across instances. Both HTTP (Layer 7) and TCP (Layer 4) load balancers are supported.
Operations
Create a Load Balancer
agentmetal lb create \
--name web-lb \
--type http \
--vpc vpc-abc123
| Flag | Required | Description |
|---|---|---|
--name | Yes | Load balancer name |
--type | Yes | Type: http (Layer 7) or tcp (Layer 4) |
--vpc | Yes | VPC ID for the load balancer |
--listener | No | Listener in format listen_port:target_port:protocol (repeatable) |
--health-path | No | Health check path for HTTP (default: /) |
--health-interval | No | Health check interval in seconds (default: 10) |
agentmetal lb list
ID NAME TYPE STATE PUBLIC IP VPC
lb-a1b2c3 web-lb http active 203.0.113.100 vpc-abc123
lb-d4e5f6 tcp-lb tcp active 203.0.113.101 vpc-abc123
Get / Delete
agentmetal lb get lb-a1b2c3
agentmetal lb delete lb-a1b2c3
Examples
Create an HTTP load balancer with multiple listeners:
agentmetal lb create \
--name api-lb \
--type http \
--vpc vpc-abc123 \
--listener "80:8080:http" \
--listener "443:8080:https" \
--health-path /healthz \
--health-interval 15
Create a TCP load balancer for database connections:
agentmetal lb create \
--name db-lb \
--type tcp \
--vpc vpc-abc123 \
--listener "5432:5432:tcp"
LoadBalancerSpec Fields
| Field | Type | Description |
|---|---|---|
type | string | http or tcp |
vpc_id | string | VPC for the load balancer |
listeners | array | List of listener configurations |
health_check | object | Health check settings (path, interval, threshold) |