Load balancers
Load Balancers
RackCorp Load Balancers are designed to be easy to use for automation, while also being globally relevant.
cmd style:
loadbalancer.create
loadbalancer.update
loadbalancer.delete
loadbalancer.get
loadbalancer.getall
REST style:
POST /loadbalancer/
PUT /loadbalancer/{id}
DELETE /loadbalancer/{id}
GET /loadbalancer/{id}
GET /loadbalancer/
Global Load Balancer GLB Relevant:
Global Load Balancers are designed to provide globally optimal connectivity for customers connecting to HTTP/HTTP-based services. RackCorp managed a global anycast network of load balancers. Redundancy for our load balancers is automatically handled by our systems delivering high-performance, low-latency load balancing.
{
"id": __LBID__,
"cmd": "loadbalancer.XXXXXXXX",
"name": "Test GLB",
"hostname": "XXXXXX.glb.XXXXXXXXX.com",
"type": "GLB",
"checkmode": "HTTP",
"checkmethod": "GET",
"checkurl": "/",
"backend_hostname_force": "www.backendhostname.com",
"aliases": [
"glbtest1.frontendhostname.com",
"glbtest2.frontendhostname.com"
],
"backends": [
{
"hostname": "www.hostnameoriptoconnectto.com",
"weight": 100,
"port": 443,
"tls": true
}
]
}
id:
Required for: update, delete, get
Integer: The ID of the load balancer instance, as returned by a create, update, get, getall operation
cmd:
Only required for cmd style, otherwise auto-determined via REST style
name:
String: Name, useful for customer to understand in GUI / billing
type:
String: GLB
hostname: (Returned by API only)
String: Hostname for customer to point their DNS to as a CNAME. Effective immediately upon creation.
checkmode:
String: "TCP" ensures a TCP connection can be made to the backend else it is deemed offline. "HTTP" performs HTTP healthcheck using checkmethod/checkurl/checkhost below. "" means backend is always treated as online (can cause delays if a backend is offline)
checkmethod:
String: GET or POST. Defaults to GET
checkurl:
String: URI to use for healthchecks. defaults to "/"
checkhost:
String: Host header to use for healthchecks. defaults to HTTP/1.0 (No host header)
backend_hostname: (Optional)
String: override Host header. Defaults to off (http Host header pass-through)
aliases: (Required)
Array of String:
String: hostname of frontend to use. Domain base must exist in domain approvals.
backends: (Required)
Array of backend:
hostname:
String: hostname or IP address of the backend server to use. Hostname minimum resolution is 30 seconds.
weight:
Integer: Value 1-64 indicating the probability relative to all backend total weight that this backend will be used
port:
Integer: TCP/UDP port number
tls:
Boolean: true / false if TLS is meant to be used for the backend. Defaults to SSL if port 443 is selected.
uuid:
String: Optionally customer-supplied UUID that can be used for backend update commands
ttl:
Integer: If a backend is not updated for ttl seconds, then it is automatically removed
TCP Load Balancer TCP Relevant:
TCP Load Balancers are useful for public and private services where only TCP-layer is required. TCP Load Balancers can also be deployed with direct LAN access, bridging the public and private network layers via secure TCP proxy.
{
"id": __LBID__,
"cmd": "loadbalancer.XXXXXXXX",
"name": "Test GLB",
"type": "GLB",
"hostname": "XXXXXX.glb.XXXXXXXXX.com",
"checkmode": "TCP",
"aliases": [
"glbtest1.frontendhostname.com",
"glbtest2.frontendhostname.com"
],
"backends": [
{
"hostname": "www.hostnameoriptoconnectto.com",
"tcpproxy": 2,
"weight": 100,
"port": 443,
"tls": true
}
]
}
id:
Required for: update, delete, get
Integer: The ID of the load balancer instance, as returned by a create, update, get, getall operation
cmd:
Only required for cmd style, otherwise auto-determined via REST style
name:
String: Name, useful for customer to understand in GUI / billing
type:
String: TCP
hostname: (Returned by API only)
String: Hostname for customer to point their DNS to as a CNAME. Effective immediately upon creation. Regional static global IPs are available for root domains (contact support).
checkmode:
String: "TCP" ensures a TCP connection can be made to the backend else it is deemed offline (Default). "" assumes the backend is always online (can cause delays if a backend is offline)
scope:
String: "global" (default). Provides access to a global set of anycasted TCP balancers directly connecting to the noted backends.
"local". Provides a local network load balancer instance. Requires scope_networkid.
scope_networkid:
The IPNetwork ID of the local network where this is to be deployed to. Network must have available IPs, and you must be using portal-registered IPs to avoid collissions. By default this will use the highest available IPs for the requested IPNetwork. If no IPs are available, it will fail.
scope_instances: (Optional, defaults 1)
Number of load balancer instances to run simultaneously. Note that Load Balancer fees are charged per-instance.
backends: (Required)
Array of backend:
hostname:
String: hostname or IP address of the backend server to use. Hostname minimum resolution is 30 seconds.
tcpproxy:
Integer: Enable TCP PROXY protocol. Only supports blank (no proxy), or 2 for version 2
weight:
Integer: Value 1-64 indicating the probability relative to all backend total weight that this backend will be used
port:
Integer: TCP/UDP port number
tls:
Boolean: true / false if TLS is meant to be used for the backend
uuid:
String: Optionally customer-supplied UUID that can be used for backend update commands
ttl:
Integer: If a backend is not updated for ttl seconds, then it is automatically removed
Backend Updating:
A lightweight API call can be used to update the backends using the UUID. Using this, all other UUID's remain untouched, only if there is a matching UUID will that backend be updated. If there is no matching UUID, then a new one is created.
Combine this function with backend TTLs to enable auto-registration / availability / removal of backends.
{
"cmd": "loadbalancer.backend.update",
"id": __LBID__,
"backends": [
{
"hostname": "1.2.3.4",
"port": 80,
"weight": 100
"tls": false,
"ttl": 600,
"uuid": "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
},
{
"hostname": "5.6.7.8",
"port": 80,
"weight": 100,
"tls": "false"
"ttl": 600,
"uuid": "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"
}
]
}