Creating a Load Balancer
A Load Balancer is a service that distributes traffic to container instances. By utilizing load balancing functionality, it automatically allocates access traffic for computing components and forwards it to the container instances of those components. Load balancing can improve the fault tolerance of computing components, scale the external service capability of those components, and enhance the availability of applications.
Platform administrators can create single-point or high-availability load balancers for any cluster on the platform, and uniformly manage and allocate load balancer resources. For example, load balancing can be assigned to projects, ensuring that only users with the appropriate project permissions can utilize the load balancing.
Please refer to the table below for explanations of related concepts in this section.
Parameter | Description |
---|
Load Balancer | A software or hardware device that distributes network requests to available nodes in a cluster. The load balancer used in the platform is a Layer 7 software load balancer. |
VIP | Virtual IP address (Virtual IP Address) is an IP address that does not correspond to a specific computer or a specific network interface card. When the load balancer is of high-availability type, the access address should be the VIP. |
Prerequisites
The high availability of the Load Balancer requires a VIP. Please refer to Configure VIP.
Creating a Load Balancer
-
Navigate to Platform Management.
-
In the left sidebar, click on Network Management > Load Balancer.
-
Click on Create Load Balancer.
-
Follow the instructions below to complete the network configuration.
Parameter | Description |
---|
Network Mode | - Host Network Mode: Only one load balancer replica is allowed to be deployed on a single node, with multiple services sharing one ALB, resulting in superior network performance.
- Container Network Mode: Multiple load balancer replicas can be deployed on a single node to meet the requirements of separate ALBs for each service, with slightly lower network performance.
|
Internal Routing and Annotations (Alpha) | - Internal Routing: When enabled, it will create an Internal LoadBalancer type routing for the load balancer's access address. Before use, ensure that the current cluster supports Internal LoadBalancer type routing. You can implement the platform's built-in LoadBalancer internal routing; for specific configuration, please refer to External Address Pool; when disabled, you need to configure an access address for the load balancer.
- Annotations: Used to declare the configuration or capabilities of Internal LoadBalancer type routing; for specifics, please refer to Annotations for Internal LoadBalancer Type Routing.
|
Access Address | The access address for load balancing, i.e., the service address of the load balancer instance. After the load balancer is successfully created, it can be accessed via this address. - In host network mode, please fill out according to actual conditions; it can be a domain name or an IP address (internal IP, external IP, VIP).
- In container network mode, it will be acquired automatically.
|
-
Follow the instructions below to complete the resource configuration.
Parameter | Description |
---|
Specification | Please set the specifications reasonably according to business needs. You can also refer to Load Balancer Selection and Planning for reference. |
Deployment Type | - Single Point: The container group of the load balancer is deployed on a single node, which may result in the risk of load balancer unavailability if a machine failure occurs.
- High Availability: Multiple container groups of the load balancer are deployed across the corresponding number of nodes, usually 3. This satisfies the load balancing needs of large business volumes while providing emergency disaster recovery capabilities.
|
Replicas | The number of replicas is the number of container groups for the load balancer. Tip: To ensure high availability of the load balancer, it is recommended that the number of replicas be no less than 3. |
Node Labels | Filter nodes using labels to deploy the load balancer. Tip: - It is recommended that the number of nodes meeting the requirements be greater than the number of load balancer replicas.
- A label with the same key can only select one (if multiple are selected, no matching hosts will be available).
|
Resource Allocation Method | - Instance: Any port within the range of 1-65535 that the load balancer instance can listen on can be provided for project use.
- Port (Alpha): Only ports within the specified range can be allocated for project use. This method allows for finer-grained resource control when port resources are limited.
|
Assigned Project | - When Resource Allocation Method is set to Instance, the load balancer can be allocated to all projects associated with the current cluster or to specified projects. In allocated projects, all Pods in all namespaces can receive requests distributed by the load balancer.
- All Projects: Allocates the load balancer for use by all projects associated with the current cluster.
- Specified Projects (Alpha): Click the dropdown box under Specified Projects and click the checkbox on the left of the project name to select one or more projects, allocating the load balancer for use by those specified projects.
Tip: You can filter projects by entering project names in the dropdown box. - No Allocation (Alpha): Temporarily does not allocate any project. After the load balancer is created, you can use the Update Project operation to update the allocation project parameters for the created load balancer.
- When Resource Allocation Method is set to Port, this item does not need to be configured. Please manually allocate port information after creating the load balancer.
|
-
Click Create. The creation process will take some time; please be patient.