Load Balancing
Direct Load Balancer
The Direct Load Balancer allows you to expose your Workload’s Ports directly through a cloud load balancer in each location where the workload is running.
Overview
Direct load balancers are created in each location where a workload is running and are configured for the standard endpoints of the workload. Customers are responsible for configuring the workload with certificates if TLS is required. Each location will obtain a public address that is configured as a possible target of the Geo DNS endpoint. The stadard latency based routing will be used for traffic distribution across the locations. Since the traffic is being routed directly to the workload through the load balancer, Domains do not need to be registered in order to receive traffic on the direct load balancer endpoints. The dns record for the workload can be configured in dns as a cname target for any source domains you wish accpet traffic for.
Configuration
The Direct Load Balancer configuration is defined in the workload using directLoadBalancer
in the workload spec, with the following properties:
direct
The direct
object contains the configuration for the Direct Load Balancer.
Property | Type | Description |
---|---|---|
enabled | boolean | When set to false , this load balancer will be stopped and no charges will accrue |
ports | array | A list of ports that will be exposed by this load balancer |
ports
Each port in the ports
array is added to the cloud load balancer to control the routing behavior:
Property | Type | Description |
---|---|---|
externalPort | number | The port that is available publicly. Must be between 22 and 32768 |
protocol | string | The protocol that is exposed publicly. Can be either ‘TCP’ or ‘UDP’ |
scheme | string (optional) | Overrides the default https URL scheme that will be used for links in the UI and status. Valid values are ‘http’, ‘tcp’, ‘https’, ‘ws’, ‘wss’ |
containerPort | object | The port on the container that will receive this traffic |
Example Configuration
Here’s an example configuration for a Direct Load Balancer:
Geo Location Headers
The Geo Location Headers feature allows you to include geographic information in inbound HTTP requests.
When enabled, this feature adds headers containing geographic information to incoming HTTP requests. These headers can provide valuable data about the origin of the request, including the Autonomous System Number (ASN), city, country, and region.
This product includes GeoLite2 data created by MaxMind, available from
Configuration
Parameter | Type | Description |
---|---|---|
enabled | boolean | When set to true , geo location headers will be included on inbound HTTP requests. Existing headers will be replaced. Default is false . |
headers.asn | string | The header name for the Autonomous System Number information. |
headers.city | string | The header name for the city information. |
headers.country | string | The header name for the country information. |
headers.region | string | The header name for the region information. |
Usage Guidelines
-
Enabling the Feature: Set
geoLocation.enabled
totrue
to activate the Geo Location Headers feature. -
Header Configuration: When enabled, you must specify at least one header (ASN, city, country, or region).
-
Unique Headers: The values for ASN, city, country, and region headers must be unique. You cannot use the same header name for different types of information.
-
Existing Headers: If enabled, this feature will replace any existing headers with the same names in incoming requests.
Notes
- Enabling this feature may have performance implications, as it requires additional processing for each incoming request.
- Enabling this feature has no effect if the workload does not expose an http port.
- Ensure that you comply with all relevant data protection and privacy regulations when using geographic information.
- The accuracy of geographic information may vary and should not be relied upon for critical decision-making without verification.
- Workloads receive the latest ip to geo database on startup.
Example Configuration
Here’s an example configuration that enables Geo Location Headers:
This configuration will add the following headers to incoming HTTP requests:
X-GeoIP-ASN
: Containing the Autonomous System NumberX-GeoIP-City
: Containing the city nameX-GeoIP-Country
: Containing the country nameX-GeoIP-Region
: Containing the region name