Create a Load Balancer
This guide walks you through creating and configuring a Load Balancer in CloudRaya to distribute incoming traffic across multiple Virtual Machines (VMs) inside a VPC.
Prerequisites
Before creating a Load Balancer, make sure:
- You have an existing VPC
- The VPC contains at least one subnet
- There is at least one running VM inside the selected subnet
- You have an available Public IP, or sufficient quota to acquire a new one
Load Balancers in CloudRaya operate at Layer 4 (transport layer) and distribute traffic based on IP and port.
Step 1: Open the Load Balancer Menu
- From the CloudRaya Control Panel home page, select your active Project
- Navigate to Network → Load Balancer
- Click + Add Load Balancer
You will be taken to the Load Balancer creation wizard.
Step 2: Select Server Region
- Choose the Region / Cloud Zone where the Load Balancer will be deployed
The Load Balancer must be deployed in the same region as the VPC and backend VMs.
Step 3: Configure VPC Settings
- Select a VPC
- Select a Subnet within the VPC
The system will automatically display:
- The VPC CIDR
- Subnet CIDR
- List of available VMs in the selected subnet
Only VMs within the selected subnet can be assigned to this Load Balancer.
Step 4: Assign a Public IP
In the Public IP section, choose one of the following:
-
Acquire IP
Automatically allocates a new Public IP (subject to quota), or -
Select Existing IP
Use a previously acquired but unused Public IP
Once selected, the Public IP will be permanently associated with this Load Balancer until released.
Step 5: Create Load Balancer Rule
5.1 Rule Name
Enter a name for the Load Balancer rule.
- Allowed characters: alphanumeric, dash (), underscore (
_) - Example:
web-lb,my-lb
5.2 Select Load Balancing Algorithm
Choose how traffic will be distributed to backend VMs:
-
Round Robin
Distributes traffic evenly across all assigned VMs. -
Least Connection
Sends traffic to the VM with the fewest active connections. -
Source
Routes traffic based on the client’s source IP address, ensuring requests from the same client are forwarded to the same backend VM.
Algorithms can be changed later after the Load Balancer is created.
5.3 Configure Port Mapping
Define how incoming traffic is forwarded:
-
Public Port
The port exposed on the Public IP (for example:80,443) -
Private Port
The destination port on backend VMs (for example:80,8080)
Example:
- Public Port:
80 - Private Port:
80
This means traffic hitting PublicIP:80 will be forwarded to backend VMs on port 80.
Step 6: Create the Load Balancer
- Review all configuration details
- Click Save
The Load Balancer will be created and appear in the Load Balancer list.
Step 7: Assign Backend VMs
After creation:
- Open the Load Balancer Detail page
- Click Assign VM
- Select one or more VMs from the subnet
- Click Assign
Traffic will start flowing only after at least one VM is assigned.
What Happens Next?
After deployment, you can:
- View Load Balancer details (Public IP, VPC, Subnet)
- Add or edit rules
- Change load balancing algorithm
- Update port mappings
- Assign or remove backend VMs
- Delete the Load Balancer when no longer needed
Notes & Best Practices
-
CloudRaya Load Balancer works at Layer 4 (TCP/UDP)
It does not inspect HTTP headers or application-level data.
-
Ensure backend VM firewalls or ACLs allow traffic on the configured private ports
-
Use Source algorithm only for basic session stickiness scenarios
-
For HTTPS termination or advanced routing, configure SSL and routing at the application level (for example, inside the VM)